forked from private-attribution/ipa
-
Notifications
You must be signed in to change notification settings - Fork 1
159 lines (128 loc) · 4.28 KB
/
check.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: CI
on:
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "src/**/*"
- "benches/**/*"
- "tests/**/*"
pull_request:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "src/**/*"
- "benches/**/*"
- "tests/**/*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
jobs:
basic:
name: Basic Checks
env:
CARGO_INCREMENTAL: 0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Check formatting
run: cargo fmt --all -- --check --config "imports_granularity=Crate,group_imports=StdExternalCrate"
- name: Clippy
if: ${{ success() || failure() }}
run: cargo clippy --tests
- name: Clippy concurrency tests
if: ${{ success() || failure() }}
run: cargo clippy --tests --features shuttle
- name: Build
if: ${{ success() || failure() }}
run: cargo build --tests
- name: Run Tests
run: cargo test
- name: Run Web Tests
run: cargo test --no-default-features --features "cli web-app real-world-infra test-fixture descriptive-gate"
- name: Run compact gate tests
run: cargo test --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate"
release:
name: Release builds and tests
runs-on: ubuntu-latest
env:
RUSTFLAGS: -C target-cpu=native
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Release Build
run: cargo build --release
- name: Build concurrency tests
run: cargo build --release --features shuttle
- name: Run concurrency tests
run: cargo test --release --features shuttle
extra:
name: Additional Builds and Concurrency Tests
env:
RUSTFLAGS: -D warnings -C target-cpu=native
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Build benchmarks
run: cargo build --benches --no-default-features --features "enable-benches descriptive-gate"
- name: Build concurrency tests (debug mode)
run: cargo build --features shuttle
- name: Run IPA bench
run: cargo bench --bench oneshot_ipa --no-default-features --features "enable-benches descriptive-gate"
- name: Run arithmetic bench
run: cargo bench --bench oneshot_arithmetic --no-default-features --features "enable-benches descriptive-gate"
- name: Run compact gate tests
run: cargo test --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate"
# sanitizers currently require nightly https://github.com/rust-lang/rust/issues/39699
sanitize:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer: [ address, leak ]
env:
TARGET: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- name: Add Rust sources
run: rustup component add rust-src
- name: Run tests with sanitizer
run: RUSTFLAGS="-Z sanitizer=${{ matrix.sanitizer }} -Z sanitizer-memory-track-origins" cargo test -Z build-std --target $TARGET