Debian Codegraph @

.github/workflows/check.yml

raw
1 name: Clippy, Format & Test
2
3 on: [ pull_request, push, workflow_dispatch ]
4
5 jobs:
6 fmt:
7 name: rustfmt
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v6
11 - uses: dtolnay/rust-toolchain@stable
12 with:
13 components: rustfmt
14 - run: cargo fmt --all -- --check
15 - run: cargo fmt --manifest-path=example_project/Cargo.toml --all -- --check
16
17 check:
18 name: cargo check
19 runs-on: ubuntu-latest
20 strategy:
21 matrix:
22 toolchain: [ stable, "1.87" ]
23 steps:
24 - uses: actions/checkout@v6
25 - uses: dtolnay/rust-toolchain@stable
26 with:
27 toolchain: ${{ matrix.toolchain }}
28 - run: cargo check --no-default-features
29 - run: cargo check --all-features
30 - run: cargo check --manifest-path=example_project/Cargo.toml
31
32 check_features:
33 name: cargo check individual features
34 runs-on: ubuntu-latest
35 strategy:
36 matrix:
37 toolchain: [ stable, "1.87" ]
38 features: [ "cargo-lock", "dependency-tree", "git2", "gix", "gix,git2", "semver", "chrono" ]
39 steps:
40 - uses: actions/checkout@v6
41 - uses: dtolnay/rust-toolchain@stable
42 with:
43 toolchain: ${{ matrix.toolchain }}
44 - run: cargo check --no-default-features --features ${{ matrix.features }}
45
46 semver_crate:
47 name: cargo check of internal crate
48 runs-on: ubuntu-latest
49 strategy:
50 matrix:
51 toolchain: [ stable, "1.87" ]
52 steps:
53 - uses: actions/checkout@v6
54 - uses: dtolnay/rust-toolchain@stable
55 with:
56 toolchain: ${{ matrix.toolchain }}
57 - run: cargo check --manifest-path=semver_check/Cargo.toml
58
59 clippy:
60 name: cargo clippy
61 runs-on: ubuntu-latest
62 steps:
63 - uses: actions/checkout@v6
64 - uses: dtolnay/rust-toolchain@stable
65 with:
66 components: clippy
67 - run: cargo clippy --all --tests -- -D warnings
68 - run: cargo clippy --all-features --all --tests -- -D warnings
69 - run: cargo clippy --manifest-path=example_project/Cargo.toml --all --tests -- --warn clippy::pedantic -D warnings
70
71 test:
72 name: cargo test
73 strategy:
74 matrix:
75 os: [ ubuntu-latest, windows-latest, macos-latest ]
76 toolchain: [ stable, nightly ]
77 runs-on: ${{ matrix.os }}
78 steps:
79 - uses: actions/checkout@v6
80 - uses: dtolnay/rust-toolchain@master
81 with:
82 targets: x86_64-unknown-none
83 toolchain: ${{ matrix.toolchain }}
84 - if: matrix.toolchain == 'nightly'
85 run: echo "RUSTFLAGS=-Zfmt-debug=none" >> $GITHUB_ENV
86 - run: cargo test --no-default-features
87 - run: cargo test --all-features
88 - run: cargo test -- --ignored nostd_testbox
89 - run: cargo run --manifest-path=example_project/Cargo.toml --no-default-features --features gix
90 - run: cargo run --manifest-path=example_project/Cargo.toml --no-default-features --features git2
91
92 test_features:
93 name: cargo test individual features
94 strategy:
95 matrix:
96 os: [ ubuntu-latest, windows-latest, macos-latest ]
97 features: [ "cargo-lock", "dependency-tree", "git2", "gix", "gix,git2", "semver", "chrono" ]
98 runs-on: ${{ matrix.os }}
99 steps:
100 - uses: actions/checkout@v6
101 - uses: dtolnay/rust-toolchain@stable
102 - run: cargo test --no-default-features
103 - run: cargo test --no-default-features --features ${{ matrix.features }}
104
105 semver:
106 name: Semver check
107 runs-on: ubuntu-latest
108 steps:
109 - uses: actions/checkout@v6
110 - run: sudo apt update && sudo apt install -y cmake
111 - uses: obi1kenobi/cargo-semver-checks-action@v2