Skip to content

Commit

Permalink
[ci] combine compiler test runs into single CI job
Browse files Browse the repository at this point in the history
`yarn workspaces run test` runs tests on all workspace members. All except the babel plugin tests are super cheap and mostly overhead. With the removed first job, total wall time might even be lower.
  • Loading branch information
kassens committed Aug 9, 2024
1 parent 2d2cc04 commit c0d7edb
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/compiler_typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ defaults:
working-directory: compiler

jobs:
discover_yarn_workspaces:
name: Discover yarn workspaces
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(find packages -mindepth 1 -maxdepth 1 -type d | sed 's!packages/!!g' | tr '\n' ',' | sed s/.$// | jq -Rsc '. / "," - [""]')" >> $GITHUB_OUTPUT

# Hardcoded to improve parallelism
lint:
name: Lint babel-plugin-react-compiler
runs-on: ubuntu-latest
Expand All @@ -47,7 +36,6 @@ jobs:
- run: yarn install --frozen-lockfile
- run: yarn workspace babel-plugin-react-compiler lint

# Hardcoded to improve parallelism
jest:
name: Jest babel-plugin-react-compiler
runs-on: ubuntu-latest
Expand All @@ -68,13 +56,8 @@ jobs:
- run: yarn workspace babel-plugin-react-compiler jest

test:
name: Test ${{ matrix.workspace_name }}
needs: discover_yarn_workspaces
name: Test
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
workspace_name: ${{ fromJSON(needs.discover_yarn_workspaces.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -89,4 +72,4 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn workspace ${{ matrix.workspace_name }} test
- run: yarn workspaces run test

0 comments on commit c0d7edb

Please sign in to comment.