Skip to content

Migrate from buildkite to github actions. #3

Migrate from buildkite to github actions.

Migrate from buildkite to github actions. #3

Workflow file for this run

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 .
# Static checks (clippy, mypy, ruff, eslint, formatting, etc.) only
# run on Linux since they produce identical results on all platforms.
- name: Build and check (Linux)
if: matrix.platform == 'linux'
env:
ONLINE_TESTS: "1"
run: ./ninja pylib qt check
- name: Build (macOS)
if: matrix.platform == 'macos'
run: ./ninja pylib qt wheels
- name: Build (Windows)
if: matrix.platform == 'windows'
shell: cmd
run: call tools\ninja build pylib qt
- 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' }}