13
13
14
14
env :
15
15
CARGO_INCREMENTAL : 0
16
+ CARGO_NET_GIT_FETCH_WITH_CLI : true
16
17
CARGO_NET_RETRY : 10
17
18
CARGO_TERM_COLOR : always
18
19
RUST_BACKTRACE : 1
@@ -26,42 +27,80 @@ defaults:
26
27
27
28
jobs :
28
29
test :
29
- runs-on : ${{ matrix.os }}
30
+ runs-on : ubuntu-latest
30
31
strategy :
31
32
fail-fast : false
32
33
matrix :
33
- os : [ubuntu-latest]
34
- rust : [nightly, beta, stable]
34
+ include :
35
+ - rust : stable
36
+ - rust : beta
37
+ - rust : nightly
38
+ - rust : nightly
39
+ target : i686-unknown-linux-gnu
35
40
steps :
36
41
- uses : actions/checkout@v4
37
42
- name : Install Rust
38
43
run : rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
44
+ - name : Install cross-compilation tools
45
+ uses : taiki-e/setup-cross-toolchain-action@v1
46
+ with :
47
+ target : ${{ matrix.target }}
48
+ if : matrix.target != ''
39
49
- run : cargo build --all --all-features --all-targets
50
+ - run : cargo test --all
51
+ - run : cargo test --all --release
52
+ - run : cargo test --no-default-features --tests
53
+ - run : cargo test --no-default-features --tests --release
54
+ - name : Install cargo-hack
55
+ uses : taiki-e/install-action@cargo-hack
56
+ - run : rustup target add thumbv7m-none-eabi
40
57
- name : Run cargo check (without dev-dependencies to catch missing feature flags)
41
- if : startsWith(matrix.rust, 'nightly')
42
- run : cargo check -Z features=dev_dep
43
- - run : cargo test
58
+ run : cargo hack build --all --no-dev-deps
59
+ - run : cargo hack build --all --target thumbv7m-none-eabi --no-default-features --no-dev-deps
60
+ - run : cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps --features portable-atomic
61
+ - name : Install wasm-pack
62
+ uses : taiki-e/install-action@wasm-pack
63
+ - run : wasm-pack test --node
64
+ - run : wasm-pack test --node --no-default-features
65
+ - run : wasm-pack test --node --no-default-features --features portable-atomic
66
+ - name : Clone some dependent crates
67
+ run : |
68
+ git clone https://github.com/smol-rs/event-listener-strategy.git
69
+ git clone https://github.com/smol-rs/async-channel.git
70
+ git clone https://github.com/smol-rs/async-lock.git
71
+ - name : Patch dependent crates
72
+ run : |
73
+ echo '[patch.crates-io]' >> event-listener-strategy/Cargo.toml
74
+ echo 'event-listener = { path = ".." }' >> event-listener-strategy/Cargo.toml
75
+ echo '[patch.crates-io]' >> async-channel/Cargo.toml
76
+ echo 'event-listener = { path = ".." }' >> async-channel/Cargo.toml
77
+ echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-channel/Cargo.toml
78
+ echo '[patch.crates-io]' >> async-lock/Cargo.toml
79
+ echo 'event-listener = { path = ".." }' >> async-lock/Cargo.toml
80
+ echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-lock/Cargo.toml
81
+ echo 'async-channel = { path = "../async-channel" }' >> async-lock/Cargo.toml
82
+ - name : Test dependent crates
83
+ run : |
84
+ cargo test --manifest-path=event-listener-strategy/Cargo.toml
85
+ cargo test --manifest-path=async-channel/Cargo.toml
86
+ cargo test --manifest-path=async-lock/Cargo.toml
44
87
45
88
msrv :
46
89
runs-on : ubuntu-latest
47
- strategy :
48
- matrix :
49
- # When updating this, the reminder to update the minimum supported
50
- # Rust version in Cargo.toml.
51
- rust : ['1.39']
52
90
steps :
53
91
- uses : actions/checkout@v4
54
- - name : Install Rust
55
- run : rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
56
- - run : cargo build
92
+ - name : Install cargo-hack
93
+ uses : taiki-e/install-action@cargo-hack
94
+ - run : cargo hack build --all --rust-version
95
+ - run : cargo hack build --all --no-default-features --rust-version
57
96
58
97
clippy :
59
98
runs-on : ubuntu-latest
60
99
steps :
61
100
- uses : actions/checkout@v4
62
101
- name : Install Rust
63
102
run : rustup update stable
64
- - run : cargo clippy --all-features --all-targets
103
+ - run : cargo clippy --all --all -features --all-targets
65
104
66
105
fmt :
67
106
runs-on : ubuntu-latest
@@ -77,10 +116,12 @@ jobs:
77
116
- uses : actions/checkout@v4
78
117
- name : Install Rust
79
118
run : rustup toolchain install nightly --component miri && rustup default nightly
80
- - run : cargo miri test
81
- env :
82
- MIRIFLAGS : -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
83
- RUSTFLAGS : ${{ env.RUSTFLAGS }} -Z randomize-layout
119
+ - run : |
120
+ echo "MIRIFLAGS=-Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation" >>"${GITHUB_ENV}"
121
+ echo "RUSTFLAGS=${RUSTFLAGS} -Z randomize-layout" >>"${GITHUB_ENV}"
122
+ - run : cargo miri test --all
123
+ - run : cargo miri test --no-default-features --tests
124
+ - run : cargo miri test --no-default-features --features portable-atomic --tests
84
125
85
126
security_audit :
86
127
permissions :
@@ -89,8 +130,17 @@ jobs:
89
130
issues : write
90
131
runs-on : ubuntu-latest
91
132
steps :
92
- - uses : actions/checkout@v3
133
+ - uses : actions/checkout@v4
93
134
# https://github.com/rustsec/audit-check/issues/2
94
135
- uses : rustsec/audit-check@master
95
136
with :
96
137
token : ${{ secrets.GITHUB_TOKEN }}
138
+
139
+ loom :
140
+ runs-on : ubuntu-latest
141
+ steps :
142
+ - uses : actions/checkout@v4
143
+ - name : Install Rust
144
+ run : rustup update stable
145
+ - name : Loom tests
146
+ run : RUSTFLAGS="--cfg=loom" cargo test --release --test loom --features loom
0 commit comments