-
Notifications
You must be signed in to change notification settings - Fork 2.9k
104 lines (88 loc) · 2.78 KB
/
ci.yml
File metadata and controls
104 lines (88 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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' }}