[ci] release #10823
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| merge_group: | |
| pull_request: | |
| branches: [main] | |
| # Automatically cancel in-progress actions on the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_VERSION: 18 | |
| ASTRO_TELEMETRY_DISABLED: true | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| docs: ${{ steps.filter.outputs.docs }} | |
| docs_ja: ${{ steps.filter.outputs.docs_ja }} | |
| docs_en: ${{ steps.filter.outputs.docs_en }} | |
| docs_not_content: ${{ steps.filter.outputs.docs_not_content }} | |
| packages: ${{ steps.filter.outputs.packages }} | |
| ci: ${{ steps.filter.outputs.ci }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| id: filter | |
| # When updating filters here, make sure to also add or remove them from the | |
| # outputs block above. | |
| with: | |
| filters: | | |
| docs: | |
| - 'docs/**' | |
| docs_ja: | |
| - 'docs/src/content/docs/ja/**' | |
| docs_en: | |
| - 'docs/src/content/docs/**' | |
| # Exclude languages with a two-letter code | |
| - '!docs/src/content/docs/{a..z}{a..z}/**' | |
| # Exclude languages with a region subtag | |
| - '!docs/src/content/docs/{a..z}{a..z}-{a..z}{a..z}/**' | |
| docs_not_content: | |
| - 'docs/**' | |
| - '!docs/src/content/docs/**' | |
| packages: | |
| - 'packages/**' | |
| ci: | |
| - '.github/workflows/ci.yml' | |
| unit-test: | |
| name: Run unit tests | |
| needs: changes | |
| if: ${{ needs.changes.outputs.packages == 'true' || needs.changes.outputs.ci == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - run: pnpm i | |
| - name: Test packages | |
| run: pnpm -r test:coverage | |
| - name: Test legacy collections support | |
| working-directory: packages/starlight | |
| run: pnpm test:legacy | |
| e2e-test: | |
| name: 'Run E2E tests (${{ matrix.os }})' | |
| needs: changes | |
| if: ${{ needs.changes.outputs.packages == 'true' || needs.changes.outputs.ci == 'true' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| # Uninstall man-db to prevent man page updates taking a long time after package installations | |
| # on Ubuntu 24.04. | |
| # https://github.com/actions/runner/issues/4030 | |
| # https://github.com/actions/runner-images/issues/10977 | |
| - name: Uninstall man-db | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get remove man-db | |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - run: pnpm i | |
| - name: Test packages (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: pnpm -r test:e2e:chrome | |
| # Firefox is used for Windows E2E tests as Chrome on Windows requires the installation of the | |
| # Server Media Foundation windows feature, which can take up to 3 minutes to install on CI. | |
| # https://github.com/microsoft/playwright/blob/e7bff526433b6dcb02801763ab5b1c6407902d47/packages/playwright-core/src/server/registry/dependencies.ts#L79-L89 | |
| - name: Test packages (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: pnpm -r test:e2e:firefox | |
| type-check: | |
| name: Run type checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - run: pnpm i | |
| - name: Generate docs types | |
| working-directory: docs | |
| run: pnpm astro sync | |
| - name: Type check packages | |
| run: pnpm typecheck | |
| lint: | |
| name: Lint code | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - run: pnpm i | |
| - name: Generate types | |
| working-directory: ./docs | |
| run: pnpm astro sync | |
| - name: Run linter | |
| run: pnpm lint | |
| a11y: | |
| name: Check for accessibility issues | |
| needs: changes | |
| if: ${{ needs.changes.outputs.docs_not_content == 'true' || needs.changes.outputs.docs_ja == 'true' || needs.changes.outputs.docs_en == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.packages == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| # Uninstall man-db to prevent man page updates taking a long time after package installations | |
| # on Ubuntu 24.04. | |
| # https://github.com/actions/runner/issues/4030 | |
| # https://github.com/actions/runner-images/issues/10977 | |
| - name: Uninstall man-db | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get remove man-db | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm i | |
| - name: Run accessibility audit | |
| working-directory: ./docs | |
| run: pnpm t | |
| windows-smoke: | |
| name: Docs site builds on Windows | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - run: pnpm i | |
| - name: Build docs site | |
| working-directory: ./docs | |
| run: pnpm build | |
| links: | |
| name: Check for broken links | |
| needs: changes | |
| if: ${{ needs.changes.outputs.docs == 'true' || needs.changes.outputs.ci == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm i | |
| - name: Build docs site and check links | |
| working-directory: ./docs | |
| run: pnpm linkcheck |