Migrate from buildkite to github actions. #10
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
| name: CI | |
| # TODO: Remove this before merging. | |
| on: [push, pull_request] | |
| # TODO: Uncomment before merging | |
| # on: | |
| # push: | |
| # branches: [main] | |
| # pull_request: | |
| # branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux | |
| runner: ubuntu-24.04 | |
| - platform: macos | |
| runner: macos-latest | |
| - platform: windows | |
| runner: windows-latest | |
| runs-on: ${{ matrix.runner }} | |
| name: check (${{ matrix.platform }}) | |
| steps: | |
| # Check out the PR head commit (not the merge ref) so that | |
| # check:minilints can verify the commit author is in CONTRIBUTORS. | |
| # The default merge ref author is GitHub, not the PR author. | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Restore cargo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index | |
| ~/.cargo/registry/cache | |
| ~/.cargo/git/db | |
| ~/.cargo/bin | |
| ~/.cargo/.crates.toml | |
| ~/.cargo/.crates2.json | |
| key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: cargo-${{ runner.os }}- | |
| # Fallback order for new PRs: | |
| # 1. build-{OS}-main (seed from latest main cache) | |
| # 2. build-{OS}- (any prior cache for this OS) | |
| - name: Restore build output cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: out | |
| key: build-${{ runner.os }}-${{ github.event.pull_request.number || 'main' }} | |
| restore-keys: | | |
| build-${{ runner.os }}-main | |
| build-${{ runner.os }}- | |
| - name: Setup build environment | |
| uses: ./.github/actions/setup-anki | |
| - name: Symlink node_modules (Linux) | |
| if: matrix.platform == 'linux' | |
| run: | | |
| ln -sf out/node_modules . | |
| rm -f out/build.ninja | |
| - name: Symlink node_modules (macOS) | |
| if: matrix.platform == 'macos' | |
| run: ln -sf out/node_modules . | |
| # Static checks (clippy, mypy, ruff, eslint, formatting, etc.) only | |
| # run on Linux since they produce identical results on all platforms. | |
| # Tests run on all platforms to catch platform-specific issues. | |
| - name: Build and check (Linux) | |
| if: matrix.platform == 'linux' | |
| env: | |
| ONLINE_TESTS: "1" | |
| run: ./ninja pylib qt check | |
| - name: Build and test (macOS) | |
| if: matrix.platform == 'macos' | |
| run: ./ninja pylib qt wheels check:rust_test check:pytest:pylib check:pytest:aqt check:vitest | |
| - name: Build and test (Windows) | |
| if: matrix.platform == 'windows' | |
| shell: cmd | |
| run: call tools\ninja build pylib qt check:rust_test check:pytest:pylib check:pytest:aqt check:vitest | |
| - name: Ensure libs importable (Linux) | |
| if: matrix.platform == 'linux' | |
| env: | |
| SKIP_RUN: "1" | |
| run: ./run | |
| - name: Check Rust dependencies (Linux) | |
| if: matrix.platform == 'linux' | |
| run: | | |
| cargo install cargo-deny@0.19.0 | |
| cargo deny check | |
| - name: Save build output cache | |
| if: always() | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: out | |
| key: build-${{ runner.os }}-${{ github.event.pull_request.number || 'main' }} |