-
Notifications
You must be signed in to change notification settings - Fork 192
105 lines (97 loc) · 3.12 KB
/
ci.yaml
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
name: CI
on: merge_group
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [
1.60.0, # MSRV
stable,
beta,
nightly
]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- run: cargo build
- run: ./ci/test_full.sh
# try a target with `BigDigit = u32`
i686:
name: Test (i686)
runs-on: ubuntu-latest
steps:
- run: |
sudo apt-get update
sudo apt-get install gcc-multilib
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable-i686-unknown-linux-gnu
- run: cargo build
- run: ./ci/test_full.sh
# try building the x32 target -- x86_64 with target_pointer_width="32"
# (we can't execute without kernel CONFIG_X86_X32_ABI though)
x32:
name: Test (x32)
runs-on: ubuntu-latest
steps:
- run: |
sudo apt-get update
sudo apt-get install gcc-multilib
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-unknown-linux-gnux32
- run: cargo build --target x86_64-unknown-linux-gnux32 --all-features
- run: cargo test --no-run --target x86_64-unknown-linux-gnux32 --all-features
# try a target that doesn't have std at all, but does have alloc
no_std:
name: No Std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- run: cargo build --target thumbv6m-none-eabi --no-default-features --features "serde rand"
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all --check
doc:
name: Docs.rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo doc --features std,serde,rand,quickcheck,arbitrary
env:
RUSTDOCFLAGS: --cfg docsrs
# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [test, i686, x32, no_std, fmt, doc]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'