Skip to content

Convert to monorepo with Yarn 4 #73

Convert to monorepo with Yarn 4

Convert to monorepo with Yarn 4 #73

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
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn workspaces focus ${{ matrix.packages }}
- name: Workround for tiged
if: matrix.packages == 'vite-template-redux'
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
YARN_CHECKSUM_BEHAVIOR: 'update'
- name: Mock the templates
run: npx tsx scripts/mockTemplates.mts ${{ matrix.packages }}
- name: Run test for ${{ matrix.packages }}
working-directory: example
run: npm run test
- name: Run lint for ${{ matrix.packages }}
working-directory: example
run: npm run lint
- name: Set up JDK 17 for React Native build
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'
- name: Build ${{ matrix.packages }}
working-directory: example
run: npm run build