Debian Codegraph @

.github/workflows/test.yaml

raw
1 name: test
2
3 on:
4 push:
5 branches:
6 - master
7 pull_request:
8
9 env:
10 CARGO_TERM_COLOR: always
11 RUST_BACKTRACE: full
12
13 jobs:
14 test:
15 name: Build & test
16 strategy:
17 fail-fast: false
18 matrix:
19 os:
20 - ubuntu-latest
21 - macos-latest
22 - windows-latest
23 rust:
24 - stable
25 - beta
26 - nightly
27 # Introduction of self: Arc<..>, needed for the iterator module
28 - 1.36.0
29 # Introduction of non_exhaustive, used at certain exfiltrators
30 - 1.40.0
31
32 runs-on: ${{ matrix.os }}
33
34 steps:
35 - name: checkout
36 uses: actions/checkout@v2
37
38 - name: Install Rust
39 uses: actions-rs/toolchain@v1
40 with:
41 toolchain: ${{ matrix.rust }}
42 default: true
43 profile: minimal
44
45 - name: Restore cache
46 uses: Swatinem/rust-cache@v1
47
48 - name: Build & test
49 env:
50 RUST_VERSION: ${{ matrix.rust }}
51 OS: ${{ matrix.os }}
52 run: ./ci-check.sh
53
54 rustfmt:
55 name: Check formatting
56 runs-on: ubuntu-latest
57 steps:
58 - name: checkout
59 uses: actions/checkout@v2
60
61 - name: Install Rust
62 uses: actions-rs/toolchain@v1
63 with:
64 profile: minimal
65 toolchain: stable
66 default: true
67 components: rustfmt
68
69 - run: cargo fmt --all -- --check
70
71 links:
72 name: Check documentation links
73 runs-on: ubuntu-latest
74 steps:
75 - name: checkout
76 uses: actions/checkout@v2
77
78 - name: Install Rust
79 uses: actions-rs/toolchain@v1
80 with:
81 toolchain: stable
82 default: true
83
84 - name: Restore cache
85 uses: Swatinem/rust-cache@v1
86
87 - name: Install cargo-deadlinks
88 uses: actions-rs/[email protected]
89 with:
90 crate: cargo-deadlinks
91 use-tool-cache: true
92
93 - name: Check links
94 run: |
95 for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .name'); do
96 cargo rustdoc -p "$package" --all-features -- -D warnings
97 dname=$(echo "$package" | tr '-' '_')
98 cargo deadlinks --dir "target/doc/$dname" --check-http --ignore-fragments
99 done
100
101 ancient-registry:
102 name: Check compilation of signal-hook-registry on 1.26.0
103 strategy:
104 matrix:
105 os:
106 - ubuntu-latest
107 - macos-latest
108 - windows-latest
109 runs-on: ${{ matrix.os }}
110 steps:
111 - name: checkout
112 uses: actions/checkout@v2
113
114 - name: Install Rust
115 uses: actions-rs/toolchain@v1
116 with:
117 toolchain: 1.26.0
118 default: true
119 profile: minimal
120
121 - name: Restore cache
122 uses: Swatinem/rust-cache@v1
123
124 - name: Check compilation
125 run: |
126 rm Cargo.toml
127 cd signal-hook-registry
128 sed -i -e '/signal-hook =/d' Cargo.toml
129 cargo check
130
131 ancient:
132 name: Check compilation on 1.31.0
133 strategy:
134 matrix:
135 os:
136 - ubuntu-latest
137 - macos-latest
138 - windows-latest
139 runs-on: ${{ matrix.os }}
140 steps:
141 - name: checkout
142 uses: actions/checkout@v2
143
144 - name: Install Rust
145 uses: actions-rs/toolchain@v1
146 with:
147 toolchain: 1.31.0
148 default: true
149 profile: minimal
150
151 - name: Restore cache
152 uses: Swatinem/rust-cache@v1
153
154 - name: Check compilation
155 run: |
156 rm Cargo.lock
157 cargo update
158 cargo check --no-default-features
159
160
161 clippy:
162 name: Clippy lints
163 runs-on: ubuntu-latest
164 steps:
165 - name: Checkout repository
166 uses: actions/checkout@v2
167
168 - name: Install Rust
169 uses: actions-rs/toolchain@v1
170 with:
171 toolchain: stable
172 profile: minimal
173 default: true
174 components: clippy
175
176 - name: Restore cache
177 uses: Swatinem/rust-cache@v1
178
179 - name: Run clippy linter
180 run: cargo clippy --all --all-features --tests -- -D clippy::all -D warnings
181
182 # There's bunch of platforms that have some weird quirks (or we don't know
183 # that they don't). While fully compiling and testing on them is a bit of a
184 # challenge, running cargo check on them should be easy enough and should
185 # catch at least some problems (like different sizes of types).
186 weird_platforms:
187 name: Check weird platforms
188 strategy:
189 fail-fast: false
190 matrix:
191 target:
192 - x86_64-unknown-linux-musl
193 - x86_64-pc-solaris
194 - x86_64-linux-android
195 - aarch64-linux-android
196 - arm-linux-androideabi
197 - mips-unknown-linux-musl
198 - x86_64-unknown-netbsd
199 - x86_64-unknown-freebsd
200 extra-args:
201 - "--all --all-features"
202 include:
203 # - wasm32-wasi (not yet? Or not ever?)
204 # - x86_64-unknown-redox (Is that platform even usable on stable?)
205 - { target: x86_64-fuchsia, extra-args: "--all-features" }
206 - { target: asmjs-unknown-emscripten, extra-args: "--all-features" }
207 # Seems we have some trouble with properly running C compiler on these. Might as well be problem with cross-compilation setup, but who knows
208 # So we avoid the exfiltrator part/signal-hook-sys :-(
209 - { target: x86_64-apple-darwin, extra-args: "--features=iterator --all --exclude signal-hook-sys" }
210 - { target: x86_64-apple-ios, extra-args: "--features=iterator --all --exclude signal-hook-sys" }
211
212 runs-on: ubuntu-latest
213 steps:
214 - name: checkout
215 uses: actions/checkout@v2
216
217 - name: Install Rust
218 uses: actions-rs/toolchain@v1
219 with:
220 toolchain: stable
221 profile: minimal
222 default: true
223 target: ${{ matrix.target }}
224
225 - name: Restore cache
226 uses: Swatinem/rust-cache@v1
227
228 - name: Run the check
229 uses: actions-rs/cargo@v1
230 with:
231 command: check
232 args: ${{ matrix.extra-args }} --tests --target=${{ matrix.target }}
233 use-cross: true