Skip to content

Commit 38a26c9

Browse files
committed
ci: consolidate into a single workflow and improve CI
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
1 parent e647fbc commit 38a26c9

6 files changed

Lines changed: 169 additions & 319 deletions

File tree

.github/workflows/check.yml

Lines changed: 0 additions & 138 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
permissions:
2+
contents: read
3+
on:
4+
pull_request:
5+
name: CI
6+
jobs:
7+
fmt:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: ${{github.event.pull_request.commits}}
13+
ref: ${{github.event.pull_request.head.sha}}
14+
- uses: dtolnay/rust-toolchain@nightly
15+
with:
16+
components: rustfmt
17+
- run: git config user.name "github-runner" && git config user.email "<>"
18+
- run: git rebase --exec 'cargo fmt --check' --root
19+
- run: git rebase --exec 'cd internal && cargo fmt --check' --root
20+
readme:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: ${{github.event.pull_request.commits}}
26+
ref: ${{github.event.pull_request.head.sha}}
27+
- uses: dtolnay/rust-toolchain@nightly
28+
- run: cargo install cargo-rdme
29+
- run: git config user.name "github-runner" && git config user.email "<>"
30+
- run: git rebase --exec 'cargo rdme --check' --root
31+
docs:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
fetch-depth: ${{github.event.pull_request.commits}}
37+
ref: ${{github.event.pull_request.head.sha}}
38+
- uses: dtolnay/rust-toolchain@nightly
39+
- uses: dtolnay/rust-toolchain@nightly
40+
with:
41+
components: rust-src
42+
- run: git config user.name "github-runner" && git config user.email "<>"
43+
- run: git rebase --exec 'cargo doc --no-deps' --root
44+
clippy:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
with:
49+
fetch-depth: ${{github.event.pull_request.commits}}
50+
ref: ${{github.event.pull_request.head.sha}}
51+
- uses: dtolnay/rust-toolchain@nightly
52+
with:
53+
components: clippy
54+
- run: cargo install cargo-hack
55+
- run: git config user.name "github-runner" && git config user.email "<>"
56+
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset clippy --locked' --exec 'cargo clean' --root
57+
test:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: dtolnay/rust-toolchain@nightly
62+
with:
63+
components: rust-src
64+
- run: cargo install cargo-expand
65+
- run: git config user.name "github-runner" && git config user.email "<>"
66+
- run: git rebase --exec 'cargo test --locked' --root
67+
miri:
68+
runs-on: ubuntu-latest
69+
name: "miri"
70+
steps:
71+
- uses: actions/checkout@v4
72+
with:
73+
fetch-depth: ${{github.event.pull_request.commits}}
74+
ref: ${{github.event.pull_request.head.sha}}
75+
- run: |
76+
echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV
77+
- name: Install ${{env.NIGHTLY}}
78+
uses: dtolnay/rust-toolchain@master
79+
with:
80+
toolchain: ${{env.NIGHTLY}}
81+
components: miri, rust-src
82+
- run: cargo install cargo-expand
83+
- run: git config user.name "github-runner" && git config user.email "<>"
84+
- run: git rebase --exec 'cargo miri test --locked' --root
85+
- run: git rebase --exec 'cargo miri test --locked' --root
86+
env:
87+
MIRIFLAGS: "-Zmiri-tree-borrows"
88+
- run: git rebase --exec 'cargo miri test --locked' --root
89+
env:
90+
MIRIFLAGS: "-Zmiri-strict-provenance"
91+
- run: git rebase --exec 'cargo miri test --locked' --root
92+
env:
93+
MIRIFLAGS: "-Zmiri-tree-borrows -Zmiri-strict-provenance"
94+
sanitizers:
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v4
98+
with:
99+
fetch-depth: ${{github.event.pull_request.commits}}
100+
ref: ${{github.event.pull_request.head.sha}}
101+
- uses: dtolnay/rust-toolchain@nightly
102+
with:
103+
components: rust-src
104+
- name: enable debug symbols
105+
run: |
106+
sudo apt install llvm
107+
- run: git config user.name "github-runner" && git config user.email "<>"
108+
# sed because of https://github.com/japaric/rust-san#unrealiable-leaksanitizer
109+
- run: git rebase --exec "sed -i '/\[features\]/i [profile.dev]' Cargo.toml && sed -i '/profile.dev/a opt-level = 1' Cargo.toml && cargo test --lib --tests --target x86_64-unknown-linux-gnu && git restore Cargo.toml" --root
110+
env:
111+
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
112+
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address"
113+
- run: git rebase --exec 'cargo test --target x86_64-unknown-linux-gnu' --root
114+
env:
115+
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak"
116+
msrv:
117+
runs-on: ubuntu-latest
118+
steps:
119+
- uses: actions/checkout@v4
120+
with:
121+
fetch-depth: ${{github.event.pull_request.commits}}
122+
ref: ${{github.event.pull_request.head.sha}}
123+
- uses: dtolnay/rust-toolchain@stable
124+
- run: cargo install cargo-hack
125+
- run: git config user.name "github-runner" && git config user.email "<>"
126+
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset --exclude-features alloc --exclude-features default --version-range 1.82.. --clean-per-version check --locked' --exec 'cargo clean' --root
127+
nightly-msrv:
128+
runs-on: ubuntu-latest
129+
steps:
130+
- uses: actions/checkout@v4
131+
with:
132+
fetch-depth: ${{github.event.pull_request.commits}}
133+
ref: ${{github.event.pull_request.head.sha}}
134+
- uses: dtolnay/rust-toolchain@stable
135+
with:
136+
components: rust-src
137+
- run: cargo install cargo-hack
138+
- run: cargo install cargo-expand
139+
- run: git config user.name "github-runner" && git config user.email "<>"
140+
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset --version-range 1.78.. --clean-per-version check --locked' --exec 'cargo clean' --root
141+
env:
142+
RUSTC_BOOTSTRAP: 1
143+
os-check:
144+
strategy:
145+
fail-fast: false
146+
matrix:
147+
os: [macos-latest, windows-latest]
148+
runs-on: ${{matrix.os}}
149+
name: "os-check (${{matrix.os}})"
150+
steps:
151+
- uses: actions/checkout@v4
152+
with:
153+
fetch-depth: ${{github.event.pull_request.commits}}
154+
ref: ${{github.event.pull_request.head.sha}}
155+
- uses: dtolnay/rust-toolchain@nightly
156+
with:
157+
components: rust-src
158+
- run: cargo install cargo-expand
159+
- run: git config user.name "github-runner" && git config user.email "<>"
160+
- run: git rebase --exec 'cargo test --locked' --root

.github/workflows/nostd.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)