diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml new file mode 100644 index 000000000000..e71a96f429f8 --- /dev/null +++ b/.github/workflows/build-lint-test.yml @@ -0,0 +1,55 @@ +name: ${{ inputs.target }} / node 20 latest + +on: + workflow_call: + inputs: + target: + description: The target to run on. + type: string + required: true + skip: + description: Whether to skip all jobs. + type: boolean + required: false + default: false + +jobs: + build-lint-test: + name: ${{ inputs.target }} / node 20 latest + runs-on: ${{ inputs.target }} + if: ${{ !inputs.skip }} + + steps: + - name: Remove the tsc problem matcher if not ubuntu-latest + if: inputs.target != 'ubuntu-latest' + run: echo "echo "::remove-matcher owner=tsc::"" + + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - name: Set up job + uses: ./.github/actions/set-up-job + + - name: ๐Ÿ”Ž Lint + run: yarn lint + + # TODO(jgmw): Re-enable when it doesn't hang + # - name: ๐Ÿฅก Check packaging and attw + # run: yarn check:package + + - name: ๐ŸŒก Test Types + run: yarn test:types + + - name: Get number of CPU cores + if: always() + id: cpu-cores + uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2 + + - name: ๐Ÿงช Test + run: yarn test-ci --minWorkers=1 --maxWorkers=${{ steps.cpu-cores.outputs.count }} + + skipped: + name: Skip / ${{ inputs.target }} / node 20 latest + runs-on: ubuntu-latest + if: ${{ inputs.skip }} + steps: + - name: Skip + run: echo "Skipping as requested from caller" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b37d40fe7831..5304ce5fffc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,55 +87,18 @@ jobs: run: yarn format:check build-lint-test: - needs: check - - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - - name: ๐Ÿ— Build, lint, test / ${{ matrix.os }} / node 20 latest - runs-on: ${{ matrix.os }} - - steps: - - name: Remove the tsc problem matcher if not ubuntu-latest - if: matrix.os != 'ubuntu-latest' - run: echo "echo "::remove-matcher owner=tsc::"" - - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - - name: Set up job - uses: ./.github/actions/set-up-job - - - name: ๐Ÿ”Ž Lint - run: yarn lint - - # TODO(jgmw): Re-enable when it doesn't hang - # - name: ๐Ÿฅก Check packaging and attw - # run: yarn check:package - - - name: ๐ŸŒก Test Types - run: yarn test:types - - - name: Get number of CPU cores - if: always() - id: cpu-cores - uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2 - - - name: ๐Ÿงช Test - run: yarn test-ci --minWorkers=1 --maxWorkers=${{ steps.cpu-cores.outputs.count }} - - build-lint-test-skip: - needs: detect-changes - if: needs.detect-changes.outputs.code == 'false' + needs: [check, detect-changes] strategy: matrix: os: [ubuntu-latest, windows-latest] - name: ๐Ÿ— Build, lint, test / ${{ matrix.os }} / node 20 latest - runs-on: ${{ matrix.os }} + name: ๐Ÿ— Build, lint, test - steps: - - run: echo "Skipped" + uses: ./.github/workflows/build-lint-test.yml + with: + target: ${{ matrix.os }} + skip: ${{ needs.detect-changes.outputs.code == 'false' }} tutorial-e2e: needs: check