|
1
|
name: CI |
|
2
|
|
|
3
|
on: |
|
4
|
push: |
|
5
|
branches: [main] |
|
6
|
pull_request: |
|
7
|
|
|
8
|
env: |
|
9
|
CARGO_TERM_COLOR: always |
|
10
|
|
|
11
|
jobs: |
|
12
|
test: |
|
13
|
name: fmt / clippy / test |
|
14
|
runs-on: ubuntu-latest |
|
15
|
steps: |
|
16
|
- uses: actions/checkout@v4 |
|
17
|
|
|
18
|
- name: Read Rust toolchain |
|
19
|
shell: bash |
|
20
|
run: | |
|
21
|
rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)" |
|
22
|
echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV" |
|
23
|
|
|
24
|
- uses: dtolnay/rust-toolchain@stable |
|
25
|
with: |
|
26
|
toolchain: ${{ env.RUST_TOOLCHAIN }} |
|
27
|
components: rustfmt, clippy |
|
28
|
|
|
29
|
- uses: Swatinem/rust-cache@v2 |
|
30
|
|
|
31
|
- name: Check formatting |
|
32
|
run: cargo fmt --all -- --check |
|
33
|
|
|
34
|
- name: Clippy |
|
35
|
run: cargo clippy --workspace --all-targets -- -D warnings |
|
36
|
|
|
37
|
- name: Test |
|
38
|
run: cargo test --workspace |
|
39
|
|
|
40
|
# Packaging breakage should show up on the pull request, not on the tag. |
|
41
|
npm-launcher: |
|
42
|
name: npm launcher typecheck |
|
43
|
runs-on: ubuntu-latest |
|
44
|
steps: |
|
45
|
- uses: actions/checkout@v4 |
|
46
|
|
|
47
|
- uses: actions/setup-node@v4 |
|
48
|
with: |
|
49
|
node-version-file: .nvmrc |
|
50
|
|
|
51
|
- name: Build the launcher |
|
52
|
working-directory: packaging/npm/si |
|
53
|
run: | |
|
54
|
npm ci |
|
55
|
npm run build |
|
56
|
|
|
57
|
pypi-wheel: |
|
58
|
name: PyPI wheel build |
|
59
|
runs-on: ubuntu-latest |
|
60
|
steps: |
|
61
|
- uses: actions/checkout@v4 |
|
62
|
|
|
63
|
- name: Read Rust toolchain |
|
64
|
shell: bash |
|
65
|
run: | |
|
66
|
rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)" |
|
67
|
echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV" |
|
68
|
|
|
69
|
- uses: dtolnay/rust-toolchain@stable |
|
70
|
with: |
|
71
|
toolchain: ${{ env.RUST_TOOLCHAIN }} |
|
72
|
|
|
73
|
- uses: Swatinem/rust-cache@v2 |
|
74
|
|
|
75
|
- name: Build wheel |
|
76
|
uses: PyO3/maturin-action@v1 |
|
77
|
with: |
|
78
|
manylinux: "off" |
|
79
|
working-directory: packaging/pypi/si |
|
80
|
args: --release --locked --out dist |