-
Notifications
You must be signed in to change notification settings - Fork 306
100 lines (80 loc) · 2.62 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
on:
push:
branches:
- master
pull_request:
branches:
- master
- version-0.4
name: tests
env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- 1.64.0 # MSRV
- nightly
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
name: Setup rust toolchain
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
name: Load dependencies from cache
- name: Fix dep versions for MSRV
if: ${{ matrix.rust == '1.64.0' }}
run: |
cargo update -p clap --precise 4.3.24 # 4.4 moves to msrv 1.70
cargo update -p clap_lex --precise 0.5.0 # 0.5.1 moves to msrv 1.70 in a patch release
cargo update -p anstyle --precise 1.0.2 # 1.0.3 moves to msrv 1.70 in a patch release
cargo update -p regex --precise 1.9.6 # 1.10 moves to msrv 1.65
- name: Build with stable features
run: cargo build --features stable
- name: Build with unstable features
if: ${{ matrix.rust == 'nightly' }}
run: cargo build --all-features
- name: Build with minimal features
run: cargo build --no-default-features
- name: Test with stable features
run: cargo test --features stable
- name: Test with minimal features
run: cargo test --no-default-features
- name: Check for non-standard formatting
if: ${{ matrix.rust == 'stable' }}
run: cargo fmt --all -- --check
- name: Check for clippy hints
if: ${{ matrix.rust == 'stable' }}
run: cargo clippy -- -D warnings
# This fails on 1.64, but works on 1.66 and later.
# https://github.com/rust-lang/rust/issues/103306
- name: Test run targeting WASI
if: ${{ matrix.rust == 'stable' }}
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
source ~/.bashrc
export PATH=$HOME/.wasmtime/bin/:$PATH
cargo install cargo-wasi
cargo wasi bench --no-default-features -- --test
nextest-compat:
name: Check compatibility with nextest
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- run: ci/nextest-compat.sh