diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a72b16c66fc8..018c2a28f07e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,10 @@ on: branches: - main - release-* + merge_group: + branches: + - main + # - release-* permissions: contents: read @@ -24,43 +28,107 @@ jobs: strategy: fail-fast: false matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest - node-version: - - '22' - - '20' - - '18' - - '16' - - '14' - bundle: - - 'true' - include: - - node-version: 'lts/*' + config: + # Main builds + - os: ubuntu-latest + node-version: '24' + bundle: true + + # Other builds (skipped in merge queues) + - os: windows-latest + node-version: '24' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + - os: macos-latest + node-version: '24' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + - os: ubuntu-latest + node-version: '22' + bundle: true + - os: windows-latest + node-version: '22' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + # Skip macOS for this version; resources are limited. + # - os: macos-latest + # node-version: '22' + # bundle: true + # skip: ${{ github.event_name == 'merge_group' }} + - os: ubuntu-latest + node-version: '20' + bundle: true + - os: windows-latest + node-version: '20' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + # Skip macOS for this version; resources are limited. + # - os: macos-latest + # node-version: '20' + # bundle: true + # skip: ${{ github.event_name == 'merge_group' }} + - os: ubuntu-latest + node-version: '18' + bundle: true + - os: windows-latest + node-version: '18' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + # Skip macOS for this version; resources are limited. + # - os: macos-latest + # node-version: '18' + # bundle: true + # skip: ${{ github.event_name == 'merge_group' }} + - os: ubuntu-latest + node-version: '16' + bundle: true + - os: windows-latest + node-version: '16' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + - os: macos-latest + node-version: '16' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + - os: ubuntu-latest + node-version: '14' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + - os: windows-latest + node-version: '14' + bundle: true + skip: ${{ github.event_name == 'merge_group' }} + # No Node 14 on ARM macOS + # - os: macos-latest + # node-version: '14' + # bundle: true + # skip: ${{ github.event_name == 'merge_group' }} + + - os: ubuntu-latest + node-version: 'lts/*' bundle: false - os: ubuntu-latest + skip: ${{ github.event_name == 'merge_group' }} + exclude: - # No Node 14 on ARM macOS - - node-version: '14' - os: macos-latest + - config: + skip: true - runs-on: ${{ matrix.os }} - name: Test Node ${{ matrix.node-version }} on ${{ matrix.os }}${{ (!matrix.bundle && ' with --no-bundle') || '' }} + runs-on: ${{ matrix.config.os }} + name: Test Node ${{ matrix.config.node-version }} on ${{ matrix.config.os }}${{ (!matrix.config.bundle && ' with --no-bundle') || '' }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use node version ${{ matrix.node-version }} + - name: Use node version ${{ matrix.config.node-version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.config.node-version }} check-latest: true - run: npm ci - name: Tests id: test # run tests, but lint separately - run: npm run test -- --no-lint --bundle=${{ matrix.bundle }} + run: npm run test -- --no-lint --bundle=${{ matrix.config.bundle }} - name: Print baseline diff on failure if: ${{ failure() && steps.test.conclusion == 'failure' }} @@ -70,6 +138,8 @@ jobs: git diff --staged --exit-code coverage: + if: ${{ github.event_name != 'merge_group' }} + runs-on: - 'self-hosted' - '1ES.Pool=TypeScript-1ES-GitHub-Large' @@ -294,6 +364,8 @@ jobs: run: npx hereby build-src --built baselines: + if: ${{ github.event_name != 'merge_group' }} + runs-on: ubuntu-latest steps: @@ -338,3 +410,27 @@ jobs: with: name: fix_baselines.patch path: fix_baselines.patch + + required: + runs-on: ubuntu-latest + if: ${{ always() }} + needs: + - test + - coverage + - lint + - knip + - format + - browser-integration + - typecheck + - smoke + - package-size + - misc + - self-check + - baselines + + steps: + - name: Check required jobs + env: + NEEDS: ${{ toJson(needs) }} + run: | + ! echo $NEEDS | jq -e 'to_entries[] | { job: .key, result: .value.result } | select((.result == "success" or .result == "skipped") | not)'