-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (94 loc) · 2.95 KB
/
ci.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
on:
push:
branches:
- main
pull_request:
branches:
- main
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- name: Lint (clippy)
run: cargo clippy --all-features --all-targets
- name: Lint (rustfmt)
run: cargo xfmt --check
- name: Run rustdoc
env:
RUSTC_BOOTSTRAP: 1 # for feature(doc_cfg)
RUSTDOCFLAGS: -Dwarnings --cfg doc_cfg
run: cargo doc --all-features --workspace
- name: Check for differences
run: git diff --exit-code
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust-version: ["1.64", stable]
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@nextest
- name: Build
run: ./scripts/commands.sh build
- name: Test
run: ./scripts/commands.sh nextest
- name: Run doctests
if: matrix.rust-version == 'stable'
run: ./scripts/commands.sh doctest
miri:
name: Miri
runs-on: ubuntu-latest
strategy:
matrix:
rust-version: [nightly]
fail-fast: false
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
components: miri
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: taiki-e/install-action@nextest
- name: Run miri
run: ./scripts/commands.sh miri
no-std:
name: Build no_std for ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
# thumbv7m-none-eabi supports atomic CAS.
# thumbv6m-none-eabi supports atomic, but not atomic CAS.
target:
- thumbv7m-none-eabi
- thumbv6m-none-eabi
rust-version: [stable]
fail-fast: false
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: taiki-e/install-action@cargo-hack
- run: ./scripts/commands.sh build-no-std --target ${{ matrix.target }}