Skip to content

Commit 8ceeff3

Browse files
committed
Synchronize CI with rust-ci-conf
https://github.com/jonhoo/rust-ci-conf
1 parent 99ceb17 commit 8ceeff3

File tree

13 files changed

+326
-244
lines changed

13 files changed

+326
-244
lines changed

.github/workflows/asan.yml

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

.github/workflows/check.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
name: check
6+
jobs:
7+
fmt:
8+
runs-on: ubuntu-latest
9+
name: stable / fmt
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
submodules: true
14+
- name: Install stable
15+
uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: stable
19+
components: rustfmt
20+
- name: cargo fmt --check
21+
uses: actions-rs/cargo@v1
22+
with:
23+
command: fmt
24+
args: --check
25+
clippy:
26+
runs-on: ubuntu-latest
27+
name: ${{ matrix.toolchain }} / clippy
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
toolchain: [stable, beta]
32+
steps:
33+
- uses: actions/checkout@v3
34+
with:
35+
submodules: true
36+
- name: Install ${{ matrix.toolchain }}
37+
uses: actions-rs/toolchain@v1
38+
with:
39+
profile: minimal
40+
toolchain: ${{ matrix.toolchain }}
41+
default: true
42+
components: clippy
43+
- name: cargo clippy
44+
uses: actions-rs/clippy-check@v1
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
doc:
48+
runs-on: ubuntu-latest
49+
name: nightly / doc
50+
steps:
51+
- uses: actions/checkout@v3
52+
with:
53+
submodules: true
54+
- name: Install nightly
55+
uses: actions-rs/toolchain@v1
56+
with:
57+
profile: minimal
58+
toolchain: nightly
59+
default: true
60+
- name: cargo doc
61+
uses: actions-rs/cargo@v1
62+
with:
63+
command: doc
64+
args: --no-deps --all-features
65+
env:
66+
RUSTDOCFLAGS: --cfg docsrs
67+
hack:
68+
runs-on: ubuntu-latest
69+
name: ubuntu / stable / features
70+
steps:
71+
- uses: actions/checkout@v3
72+
with:
73+
submodules: true
74+
- name: Install stable
75+
uses: actions-rs/toolchain@v1
76+
with:
77+
profile: minimal
78+
toolchain: stable
79+
- name: cargo install cargo-hack
80+
uses: taiki-e/install-action@cargo-hack
81+
- name: cargo hack
82+
uses: actions-rs/cargo@v1
83+
with:
84+
command: hack
85+
args: --feature-powerset check --all-targets
86+
msrv:
87+
runs-on: ubuntu-latest
88+
# we use a matrix here just because env can't be used in job names
89+
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
90+
strategy:
91+
matrix:
92+
msrv: [1.40.0]
93+
name: ubuntu / ${{ matrix.msrv }}
94+
steps:
95+
- uses: actions/checkout@v3
96+
with:
97+
submodules: true
98+
- name: Install ${{ matrix.toolchain }}
99+
uses: actions-rs/toolchain@v1
100+
with:
101+
profile: minimal
102+
toolchain: ${{ matrix.msrv }}
103+
default: true
104+
- name: cargo +${{ matrix.msrv }} check
105+
uses: actions-rs/cargo@v1
106+
with:
107+
command: check

.github/workflows/features.yml

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

.github/workflows/loom.yml

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

.github/workflows/lsan.yml

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

.github/workflows/minimal.yml

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

.github/workflows/miri.yml

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

.github/workflows/msrv.yml

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

.github/workflows/safety.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
name: safety
6+
jobs:
7+
sanitizers:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
submodules: true
13+
- name: Install nightly
14+
uses: actions-rs/toolchain@v1
15+
with:
16+
profile: minimal
17+
toolchain: nightly
18+
default: true
19+
- run: |
20+
# to get the symbolizer for debug symbol resolution
21+
sudo apt install llvm
22+
# to fix buggy leak analyzer:
23+
# https://github.com/japaric/rust-san#unrealiable-leaksanitizer
24+
sed -i '/\[features\]/i [profile.dev]' Cargo.toml
25+
sed -i '/profile.dev/a opt-level = 1' Cargo.toml
26+
cat Cargo.toml
27+
name: Enable debug symbols
28+
- name: cargo test -Zsanitizer=address
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: test
32+
# only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945
33+
args: --lib --tests --all-features --target x86_64-unknown-linux-gnu
34+
env:
35+
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
36+
RUSTFLAGS: "-Z sanitizer=address"
37+
- name: cargo test -Zsanitizer=leak
38+
if: always()
39+
uses: actions-rs/cargo@v1
40+
with:
41+
command: test
42+
args: --all-features --target x86_64-unknown-linux-gnu
43+
env:
44+
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"
45+
RUSTFLAGS: "-Z sanitizer=leak"
46+
miri:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v3
50+
with:
51+
submodules: true
52+
- run: |
53+
echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV
54+
- name: Install ${{ env.NIGHTLY }}
55+
uses: actions-rs/toolchain@v1
56+
with:
57+
profile: minimal
58+
toolchain: ${{ env.NIGHTLY }}
59+
default: true
60+
components: miri
61+
- name: cargo miri test
62+
uses: actions-rs/cargo@v1
63+
with:
64+
command: miri
65+
args: test
66+
env:
67+
MIRIFLAGS: "-Zmiri-tag-raw-pointers"
68+
loom:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v3
72+
with:
73+
submodules: true
74+
- name: Install stable
75+
uses: actions-rs/toolchain@v1
76+
with:
77+
toolchain: stable
78+
profile: minimal
79+
- name: cargo test --test loom
80+
uses: actions-rs/cargo@v1
81+
with:
82+
command: test
83+
args: --release --test loom
84+
env:
85+
LOOM_MAX_PREEMPTIONS: 3
86+
RUSTFLAGS: "--cfg loom"

0 commit comments

Comments
 (0)