Skip to content

Convert to monorepo with Yarn 4 #166

Convert to monorepo with Yarn 4

Convert to monorepo with Yarn 4 #166

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
name: Test and lint ${{ matrix.packages }} on Node.js ${{ matrix.node }} and ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [20.x]
os: [ubuntu-latest, windows-latest]
packages:
[
'cra-template-redux',
'cra-template-redux-typescript',
'expo-template-redux-typescript',
'react-native-template-redux-typescript',
'vite-template-redux',
]
steps:
- name: Checkout repository for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Checkout repository for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node }} for ${{ matrix.packages }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Mock the templates for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
run: npx tsx scripts/mockTemplates.mts ${{ matrix.packages }}
- name: Run test for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
working-directory: example
run: npm run test
# - name: Run lint for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
# working-directory: example
# run: npm run lint
- name: Set up JDK 17 for React Native build for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
if: matrix.packages == 'react-native-template-redux-typescript' || matrix.packages == 'expo-template-redux-typescript'
uses: actions/setup-java@v4
with:
java-version: '17.x'
distribution: 'temurin'
cache: 'gradle'
- name: Build ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
working-directory: example
run: npm run build