forked from private-attribution/ipa
-
Notifications
You must be signed in to change notification settings - Fork 0
247 lines (204 loc) · 7.4 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
name: CI
on:
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "ipa-*/src/**/*"
- "ipa-core/benches/**/*"
- "ipa-core/tests/**/*"
- ".github/**/*"
pull_request:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "ipa-*/src/**/*"
- "ipa-core/benches/**/*"
- "ipa-core/tests/**/*"
- ".github/**/*"
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@v4
- uses: ./.github/actions/rm
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/cache@v4
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 --features "cli test-fixture" --tests
- name: Clippy concurrency tests
if: ${{ success() || failure() }}
run: cargo clippy --tests --features shuttle
- name: Clippy web
if: ${{ success() || failure() }}
run: cargo clippy --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate"
- name: Build
if: ${{ success() || failure() }}
run: cargo build --tests
- name: Run tests
run: cargo test --features "cli test-fixture relaxed-dp"
- name: Run tests with multithreading feature enabled
run: cargo test --features "multi-threading"
- name: Run Web Tests
run: cargo test -p ipa-core --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@v4
- uses: ./.github/actions/rm
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/cache@v4
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 multi-threading"
- name: Run concurrency tests
run: cargo test --release --features "shuttle multi-threading"
extra:
name: Additional Builds and Concurrency Tests
env:
RUSTFLAGS: -D warnings -C target-cpu=native
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rm
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/cache@v4
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 compact-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 compact-gate"
- name: Run arithmetic bench
run: cargo bench --bench oneshot_arithmetic --no-default-features --features "enable-benches compact-gate"
- name: Run compact gate tests for HTTP stack
run: cargo test --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate"
- name: Run in-memory compact gate tests
run: cargo test --features "compact-gate"
slow:
name: Slow tests
env:
EXEC_SLOW_TESTS: 1
RUSTFLAGS: -C target-cpu=native
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rm
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Integration Tests - Compact Gate
run: cargo test --release --test "compact_gate" --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate"
- name: Integration Tests - Helper Networks
run: cargo test --release --test "helper_networks" --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate"
- name: Integration Tests - Hybrid
run: cargo test --release --test "hybrid" --features "cli test-fixture"
- name: Integration Tests - IPA with Relaxed DP
run: cargo test --release --test "ipa_with_relaxed_dp" --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate relaxed-dp"
# 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]
features: ['', 'multi-threading']
env:
TARGET: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rm
- 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 -p ipa-core --target $TARGET --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate ${{ matrix.features }}"
miri:
runs-on: ubuntu-latest
env:
TARGET: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rm
- uses: dtolnay/rust-toolchain@nightly
- name: Add Miri
run: rustup component add miri
- name: Setup Miri
run: cargo miri setup
- name: Run seq_join tests
run: cargo miri test --target $TARGET --lib seq_join --features "multi-threading"
coverage:
name: Measure coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/rm
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Measure coverage
run: ./scripts/coverage-ci --lcov --output-path ipa.cov
- name: Report to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ipa.cov
fail_ci_if_error: false