Skip to content

Commit 990feef

Browse files
authored
Merge pull request #193 from hanna-kruppe/ci-fixes
Various CI fixes
2 parents 58ab668 + f6a6be4 commit 990feef

File tree

29 files changed

+224
-209
lines changed

29 files changed

+224
-209
lines changed

.github/actions-rs/grcov.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/audit.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
- uses: actions-rs/audit-check@35b7b53b1e25b55642157ac01b4adceb5b9ebef3
15+
- uses: rustsec/audit-check@v2.0.0
1616
with:
1717
token: ${{ secrets.GITHUB_TOKEN }}
18+
# ignoring RUSTSEC-2024-0019 because it's behind an opt-in feature and
19+
# the affected types (named pipes) are not used
20+
ignore: RUSTSEC-2024-0019

.github/workflows/coverage.yaml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,20 @@ jobs:
1919
uses: actions/checkout@v2
2020

2121
- name: Install Rust
22-
uses: actions-rs/toolchain@v1
23-
with:
24-
toolchain: nightly
25-
profile: minimal
26-
default: true
22+
run: rustup update stable
2723

28-
- name: Pre-installing grcov
29-
uses: actions-rs/install@v0.1
30-
with:
31-
crate: grcov
32-
use-tool-cache: true
24+
- name: Install cargo-llvm-cov
25+
uses: taiki-e/install-action@cargo-llvm-cov
3326

3427
- name: Restore cache
3528
uses: Swatinem/rust-cache@v1
3629

37-
- name: Run tests
38-
run: cargo test --all --all-features
39-
env:
40-
CARGO_INCREMENTAL: '0'
41-
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
42-
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
43-
# This seems not to work, the C code can't seem to find the gcov functions. By not providing this, we probably give up coverage from these :-(
44-
#CFLAGS: --coverage
45-
#CXXFLAGS: --coverage
46-
47-
- name: Generate coverage
48-
uses: actions-rs/grcov@v0.1
30+
- name: Generate code coverage
31+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
4932

5033
- name: Upload to codecov.io
5134
uses: codecov/codecov-action@5a8bb4701eca7ba3673f21664b887f652c58d0a3
5235
with:
5336
token: ${{ secrets.CODECOV_TOKEN }}
37+
files: lcov.info
38+
fail_ci_if_error: true

.github/workflows/test.yaml

Lines changed: 40 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
- 1.36.0
2929
# Introduction of non_exhaustive, used at certain exfiltrators
3030
- 1.40.0
31+
exclude:
32+
# macos-latest is aarch64, old Rust doesn't know that target
33+
- os: macos-latest
34+
rust: 1.36.0
35+
- os: macos-latest
36+
rust: 1.40.0
3137

3238
runs-on: ${{ matrix.os }}
3339

@@ -36,11 +42,9 @@ jobs:
3642
uses: actions/checkout@v2
3743

3844
- name: Install Rust
39-
uses: actions-rs/toolchain@v1
40-
with:
41-
toolchain: ${{ matrix.rust }}
42-
default: true
43-
profile: minimal
45+
run: |
46+
rustup toolchain add ${{ matrix.rust }} --profile minimal
47+
rustup default ${{ matrix.rust }}
4448
4549
- name: Restore cache
4650
uses: Swatinem/rust-cache@v1
@@ -50,6 +54,7 @@ jobs:
5054
RUST_VERSION: ${{ matrix.rust }}
5155
OS: ${{ matrix.os }}
5256
run: ./ci-check.sh
57+
shell: bash
5358

5459
rustfmt:
5560
name: Check formatting
@@ -59,12 +64,9 @@ jobs:
5964
uses: actions/checkout@v2
6065

6166
- name: Install Rust
62-
uses: actions-rs/toolchain@v1
63-
with:
64-
profile: minimal
65-
toolchain: stable
66-
default: true
67-
components: rustfmt
67+
run: |
68+
rustup update stable
69+
rustup component add rustfmt
6870
6971
- run: cargo fmt --all -- --check
7072

@@ -76,19 +78,13 @@ jobs:
7678
uses: actions/checkout@v2
7779

7880
- name: Install Rust
79-
uses: actions-rs/toolchain@v1
80-
with:
81-
toolchain: stable
82-
default: true
81+
run: rustup update stable
8382

8483
- name: Restore cache
8584
uses: Swatinem/rust-cache@v1
8685

8786
- name: Install cargo-deadlinks
88-
uses: actions-rs/install@v0.1
89-
with:
90-
crate: cargo-deadlinks
91-
use-tool-cache: true
87+
run: cargo install cargo-deadlinks
9288

9389
- name: Check links
9490
run: |
@@ -104,28 +100,25 @@ jobs:
104100
matrix:
105101
os:
106102
- ubuntu-latest
107-
- macos-latest
108103
- windows-latest
104+
# no macos-latest because that's aarch64 and old Rust lacks that target
105+
# no macos-15-intel because of weird linker errors
109106
runs-on: ${{ matrix.os }}
110107
steps:
111108
- name: checkout
112109
uses: actions/checkout@v2
113110

114111
- 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
112+
run: |
113+
rustup toolchain install 1.26.0 --profile minimal
114+
rustup default 1.26.0
123115
124116
- name: Check compilation
125117
run: |
126118
rm Cargo.toml
127119
cd signal-hook-registry
128120
sed -i -e '/signal-hook =/d' Cargo.toml
121+
sed -i -e 's/libc = "^0.2"/libc = "=0.2.156"/' Cargo.toml
129122
cargo check
130123
131124
ancient:
@@ -134,26 +127,23 @@ jobs:
134127
matrix:
135128
os:
136129
- ubuntu-latest
137-
- macos-latest
138130
- windows-latest
131+
# no macos-latest because that's aarch64 and old Rust lacks that target
132+
# no macos-15-intel because of weird linker errors
139133
runs-on: ${{ matrix.os }}
140134
steps:
141135
- name: checkout
142136
uses: actions/checkout@v2
143137

144138
- 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
139+
run: |
140+
rustup toolchain update 1.31.0 --profile minimal
141+
rustup default 1.31.0
153142
154143
- name: Check compilation
155144
run: |
156145
rm Cargo.lock
146+
sed -i -e 's/libc = "^0.2"/libc = "=0.2.156"/' Cargo.toml
157147
cargo update
158148
cargo check --no-default-features
159149
@@ -166,18 +156,14 @@ jobs:
166156
uses: actions/checkout@v2
167157

168158
- name: Install Rust
169-
uses: actions-rs/toolchain@v1
170-
with:
171-
toolchain: stable
172-
profile: minimal
173-
default: true
174-
components: clippy
159+
run: rustup toolchain update stable --profile minimal --component clippy
175160

176161
- name: Restore cache
177162
uses: Swatinem/rust-cache@v1
178163

179164
- name: Run clippy linter
180-
run: cargo clippy --all --all-features --tests -- -D clippy::all -D warnings
165+
# cfg(clippy) is necessary in signal-hook-registry because Rust 1.26 doesn't support allow(clippy::foo)
166+
run: cargo clippy --all --all-features --tests -- -D clippy::all -D warnings -A clippy::unnecessary_clippy_cfg
181167

182168
# There's bunch of platforms that have some weird quirks (or we don't know
183169
# that they don't). While fully compiling and testing on them is a bit of a
@@ -190,20 +176,18 @@ jobs:
190176
matrix:
191177
target:
192178
- x86_64-unknown-linux-musl
193-
- x86_64-pc-solaris
194179
- x86_64-linux-android
195180
- aarch64-linux-android
196181
- arm-linux-androideabi
197-
- mips-unknown-linux-musl
182+
- s390x-unknown-linux-gnu
198183
- x86_64-unknown-netbsd
199184
- x86_64-unknown-freebsd
200185
extra-args:
201186
- "--all --all-features"
202187
include:
203188
# - wasm32-wasi (not yet? Or not ever?)
204189
# - 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" }
190+
- { target: x86_64-unknown-fuchsia, extra-args: "--all-features" }
207191
# Seems we have some trouble with properly running C compiler on these. Might as well be problem with cross-compilation setup, but who knows
208192
# So we avoid the exfiltrator part/signal-hook-sys :-(
209193
- { target: x86_64-apple-darwin, extra-args: "--features=iterator --all --exclude signal-hook-sys" }
@@ -215,19 +199,17 @@ jobs:
215199
uses: actions/checkout@v2
216200

217201
- name: Install Rust
218-
uses: actions-rs/toolchain@v1
202+
run: |
203+
rustup update stable
204+
rustup target add ${{ matrix.target }}
205+
206+
- name: Install cross
207+
uses: taiki-e/install-action@v2
219208
with:
220-
toolchain: stable
221-
profile: minimal
222-
default: true
223-
target: ${{ matrix.target }}
209+
tool: cross@0.2.5
224210

225211
- name: Restore cache
226212
uses: Swatinem/rust-cache@v1
227213

228214
- 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
215+
run: cross check ${{ matrix.extra-args }} --tests --target=${{ matrix.target }}

Cargo.lock

Lines changed: 8 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ readme = "README.md"
1212
keywords = ["signal", "unix", "daemon"]
1313
license = "MIT OR Apache-2.0"
1414
edition = "2018"
15+
rust-version = "1.31"
1516

1617
[badges]
1718
maintenance = { status = "actively-developed" }
@@ -31,14 +32,15 @@ members = [
3132
"signal-hook-tokio",
3233
"signal-hook-mio",
3334
"signal-hook-async-std",
35+
"serial_test",
3436
]
3537

3638
[dependencies]
3739
libc = "^0.2"
3840
signal-hook-registry = { version = "^1.4", path = "signal-hook-registry" }
3941

4042
[dev-dependencies]
41-
serial_test = "^3"
43+
serial_test = { path = "./serial_test" }
4244

4345
[package.metadata.docs.rs]
4446
all-features = true

build.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#[cfg(feature = "extended-siginfo-raw")]
22
fn main() {
3-
cc::Build::new()
4-
.file("src/low_level/extract.c")
5-
.compile("extract");
3+
// Only supported for non-Windows targets
4+
if std::env::var_os("CARGO_CFG_WINDOWS").is_none() {
5+
cc::Build::new()
6+
.file("src/low_level/extract.c")
7+
.compile("extract");
8+
}
69
}
710

811
#[cfg(not(feature = "extended-siginfo-raw"))]

ci-check.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
set -ex
99

1010
rm -f Cargo.lock
11+
12+
if [ "$RUST_VERSION" = 1.36.0 ] || [ "$RUST_VERSION" = 1.40.0 ] ; then
13+
sed -i -e 's/libc = "^0.2"/libc = "=0.2.156"/' Cargo.toml
14+
sed -i -e 's/cc = { version = "^1"/cc = { version = "=1.0.79"/' Cargo.toml
15+
fi
16+
1117
cargo build --all --exclude signal-hook-async-std --exclude signal-hook-tokio
1218

1319
if [ "$RUST_VERSION" = 1.36.0 ] ; then

0 commit comments

Comments
 (0)