-
-
Notifications
You must be signed in to change notification settings - Fork 9
89 lines (83 loc) · 2.68 KB
/
ci.yml
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
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
check-all:
runs-on: ubuntu-latest
strategy:
matrix:
registry:
- crates
- github
- npm
- pypi
http_client:
- ureq
- reqwest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: cargo check --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }}
- run: cargo fmt --all --check
- run: cargo clippy --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }} -- -D warnings
- run: cargo build --release --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }}
test-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
all_registries: ["crates,github,npm,pypi"]
http_client:
- ureq
- reqwest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
# https://github.com/dtolnay/rust-toolchain/issues/29
- run: rustup override set nightly
- name: Set grcov version
run: echo "GRCOV_VERSION=$(cargo search --limit 1 grcov | head -n1 | cut -d '"' -f2)" >> $GITHUB_ENV
- run: cargo install --version $GRCOV_VERSION grcov
- name: Clean coverage
run: |
rm -f target/debug/deps/*.gcda
rm -f target/debug/deps/*.gcno
- uses: Swatinem/[email protected]
with:
key: ${{ env.GRCOV_VERSION }}
- run: cargo test --no-fail-fast --no-default-features --features ${{ matrix.all_registries }},${{ matrix.http_client }}
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: |
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off
RUSTDOCFLAGS: |
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off
- uses: actions-rs/[email protected]
- uses: codecov/codecov-action@v4
with:
file: ./lcov.info
cargo-sort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: cargo install cargo-sort
- run: cargo-sort --check
links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lycheeverse/[email protected]
with:
args: . --verbose --exclude "pkg_name|your_own_registry"
fail: true
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dprint/[email protected]