Migrate from buildkite to github actions. #2
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: | |
| - uses: actions/checkout@v4 | |
| - name: Restore cargo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ~/.cargo/bin | |
| 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 . | |
| - name: Build and test (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 | |
| - name: Build and test (Windows) | |
| if: matrix.platform == 'windows' | |
| shell: cmd | |
| run: call tools\ninja build pylib qt check | |
| - 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' }} |