-
Notifications
You must be signed in to change notification settings - Fork 13
99 lines (93 loc) · 2.75 KB
/
rust.yml
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
on: [pull_request]
name: Rust CI
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Load rust cache
uses: astriaorg/[email protected]
- name: Run cargo check, failing on warnings
run: cargo check --profile ci --all-targets
# It'd be nice to fail on warnings, but we're not ready for that.
# env:
# RUSTFLAGS: "-D warnings"
test:
name: Test Suite
runs-on: buildjet-16vcpu-ubuntu-2204
# We want to run the tests twice, once with the
# default backend (u64) and one with the u32_backend,
# in both cases with the r1cs feature enabled.
strategy:
matrix:
backend: ["r1cs", "r1cs,u32_backend"]
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Load rust cache
uses: astriaorg/[email protected]
- name: Run tests with nextest
run: cargo nextest run --cargo-profile ci --profile ci --features ${{ matrix.backend }}
env:
CARGO_TERM_COLOR: always
build_no_alloc:
name: build without alloc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup target add thumbv7em-none-eabihf
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: build
args: --target thumbv7em-none-eabihf --no-default-features
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
no-std:
name: no_std compatibility check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features