Repository navigation
chore(ci): split OS-independent checks into their own jobs #3439
Workflow file for this run
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
| # GitHub Actions docs | |
| # https://help.github.com/en/articles/about-github-actions | |
| # https://help.github.com/en/articles/workflow-syntax-for-github-actions | |
| name: Validate Docs | |
| on: [pull_request] | |
| env: | |
| NODE_VERSION: 24 | |
| jobs: | |
| # The result does not vary by operating system, so this runs once. | |
| admonitions: | |
| name: Check Admonitions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| # The check diffs against the pull request base, so it needs history. | |
| fetch-depth: 0 | |
| - uses: ./.github/workflows/actions/check-admonitions | |
| # These produce the same verdict on any operating system, so they run once. | |
| checks: | |
| name: Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: ⚙️ Use Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - name: 🕸️ Install Dependencies | |
| run: npm ci | |
| - name: Test | |
| run: npm run test | |
| - name: 🧩 Typecheck | |
| run: npm run typecheck | |
| - name: 🔤 Spell Check | |
| run: npm run spellcheck | |
| - uses: ./.github/workflows/actions/check-translations | |
| cross-platform: | |
| name: Cross-platform on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # Build processes work differently across operating systems, so the | |
| # checks run on each one to make sure anyone can contribute to the | |
| # docs. | |
| os: [windows-latest, macOS-latest] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: ⚙️ Use Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - name: 🕸️ Install Dependencies | |
| run: npm ci | |
| # Prettier rewrites line endings, so this is the check most likely to | |
| # differ between operating systems. | |
| - name: 🖌️ Lint | |
| run: npm run lint | |
| # Lint changes should be pushed to the branch before the branch is merge | |
| # eligible. | |
| - name: 🔍 Check Diff | |
| run: git diff --exit-code | |
| shell: bash | |
| # One stable name for branch protection, so the matrix can change freely. | |
| verify: | |
| # The required check on main and the feature branches. Renaming this | |
| # blocks merges until the protection rules are updated to match. | |
| name: Verify | |
| if: ${{ always() }} | |
| needs: [admonitions, checks, cross-platform] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check job status | |
| if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
| run: exit 1 |