-
Notifications
You must be signed in to change notification settings - Fork 6
184 lines (168 loc) · 4.94 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
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
name: Rust CI
on:
push:
branches:
- main
pull_request:
paths:
- .github/workflows/*.yml
- Cargo.toml
- crates/**
- src/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUSTDOCFLAGS: "-Dwarnings"
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: 1
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
test:
strategy:
matrix:
target:
- { os: ubuntu-latest, toolchain: stable, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, toolchain: beta, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, toolchain: nightly, triple: x86_64-unknown-linux-gnu }
- { os: windows-latest, toolchain: stable, triple: i686-pc-windows-msvc }
- { os: macos-latest, toolchain: stable, triple: x86_64-apple-darwin }
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.target.toolchain }}
targets: ${{ matrix.target.triple }}
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- run: cargo nextest run --workspace --all-features --profile ci
- run: cargo test --doc --workspace --all-features --no-fail-fast
fuzz:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 900
strategy:
matrix:
item:
- { name: pica-record-ref, fuzz-dir: fuzz, target: fuzz-record-ref, max-total-time: 120 }
- { name: pica-record-matcher, fuzz-dir: fuzz, target: fuzz-record-matcher, max-total-time: 200 }
- { name: pica-path, fuzz-dir: fuzz, target: fuzz-path, max-total-time: 200 }
- { name: pica-format, fuzz-dir: fuzz, target: fuzz-format, max-total-time: 200 }
- { name: pica-query, fuzz-dir: fuzz, target: fuzz-query, max-total-time: 200 }
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/install@cargo-fuzz
- run: |
cargo fuzz run --fuzz-dir ${{ matrix.item.fuzz-dir }} --jobs 2 ${{ matrix.item.target }} -- -max_total_time=${{ matrix.item.max-total-time }}
rustfmt:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all --check
rustdoc:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo doc --no-deps
clippy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-features
msrv:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --all-features
udeps:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo install --locked cargo-udeps
- run: cargo udeps --workspace
outdated:
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 45
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install --locked cargo-outdated
- run: cargo outdated -w -d 1 --exit-code 1
deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- bans licenses sources
- advisories
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
rust-version: stable
publish:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
needs:
- clippy
- deny
- fuzz
- msrv
- outdated
- rustdoc
- rustfmt
- test
- udeps
steps:
- uses: actions/checkout@v4
- uses: quarto-dev/quarto-actions/setup@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tinytex: true
- uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
path: docs/book
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ci:
runs-on: ubuntu-latest
needs: publish
steps:
- run: exit 0