Repository navigation
189 lines (176 loc) · 6.85 KB
/
Copy pathci.yml
File metadata and controls
189 lines (176 loc) · 6.85 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
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
checks: write
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
with:
components: rustfmt
- run: cargo +nightly fmt --all --check
clippy:
name: Clippy (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
with:
components: clippy
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: cargo +nightly clippy --all-targets --all-features -- -D warnings
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Install nextest
uses: taiki-e/install-action@328a871ad8f62ecac78390391f463ccabc974b72 # v2
with:
tool: cargo-nextest
- name: Run tests
run: cargo +nightly nextest run --all-features --profile ci
- name: Test Report
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
if: success() || failure()
with:
name: Rust Tests (${{ matrix.os }})
path: target/nextest/ci/junit.xml
reporter: java-junit
- name: Test with ASM feature
run: cargo +nightly test --features asm
- name: Test without ASM (portable fallback)
run: cargo +nightly test --no-default-features -p mantis-queue -p mantis-core -p mantis-types -p mantis-seqlock -p mantis-market-state
test-no-std:
name: Test no_std (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: cargo +nightly test -p mantis-core -p mantis-types -p mantis-queue -p mantis-seqlock -p mantis-market-state --no-default-features
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: cargo +nightly doc --no-deps --all-features
env:
RUSTDOCFLAGS: -Dwarnings
deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: taiki-e/install-action@328a871ad8f62ecac78390391f463ccabc974b72 # v2
with:
tool: cargo-deny
- run: cargo deny check
miri:
name: Miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
with:
components: miri
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
# Queue: --lib only (integration tests use inline asm via cold_path/prefetch)
- run: cargo +nightly miri test -p mantis-queue --lib --all-features
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check
- run: cargo +nightly miri test -p mantis-seqlock --lib
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check
# Strategy + events + types + market-state: safe crates
# fill_probability tests excluded via #[cfg(not(miri))] (libm uses inline asm)
- run: cargo +nightly miri test -p mantis-strategy -p mantis-events -p mantis-types -p mantis-market-state
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check
careful:
name: Cargo Careful
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
- uses: taiki-e/install-action@328a871ad8f62ecac78390391f463ccabc974b72 # v2
with:
tool: cargo-careful
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: cargo +nightly careful test --all-features
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@0f1b44df7e9cbb178d781a242338dfa5e243ad7f # nightly
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@328a871ad8f62ecac78390391f463ccabc974b72 # v2
with:
tool: cargo-llvm-cov
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Line coverage
run: cargo +nightly llvm-cov --all-features --codecov --output-path codecov.json
- name: Branch coverage
run: cargo +nightly llvm-cov --all-features --branch --lcov --output-path lcov-branch.info
- name: Upload to Codecov
if: github.event_name == 'pull_request'
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
files: codecov.json
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Upload coverage artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: coverage-report
path: |
codecov.json
lcov-branch.info