Skip to content

Commit 48ad681

Browse files
authored
fix nightly lints surprise build breakage (#51)
* fix nightly lints surprise build breakage * speed up cargo bundle-licenses * improve caching on all builds * make license check even faster * continue running lints even if one fails * simplify the lints * use stable version instead of pinned nightly * add cache key description
1 parent bef75ac commit 48ad681

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

.github/actions/cache/action.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ runs:
1616
uses: actions/cache@v3
1717
with:
1818
path: |
19-
~/.cargo/registry/
2019
~/.cargo/git/db/
20+
~/.cargo/registry/index/
21+
~/.cargo/registry/cache/
2122
~/.cargo/bin/
2223
target/
23-
key: v1-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ inputs.rust_version }}-${{ inputs.build_profile }}
24+
key: v1-${{ runner.os }}-cargo-${{ inputs.rust_version }}-${{ hashFiles('**/Cargo.toml') }}-${{ inputs.build_profile }}
25+
restore-keys: |
26+
v1-${{ runner.os }}-cargo-${{ inputs.rust_version }}-${{ hashFiles('**/Cargo.toml') }}-
27+
v1-${{ runner.os }}-cargo-${{ inputs.rust_version }}-

.github/workflows/lint.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@ jobs:
1515
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
1616
- run: cargo fmt --all -- --check
1717
clippy:
18-
name: "clippy #${{ matrix.version }}"
18+
name: "clippy #${{ matrix.rust_version }}"
1919
strategy:
20+
fail-fast: false
2021
matrix:
21-
version: [nightly, "1.60"]
22+
rust_version: ["nightly", "1.60.0", "stable"]
2223
runs-on: ubuntu-latest
2324
steps:
2425
- name: Checkout sources
2526
uses: actions/checkout@v2
2627
- name: Cache
2728
uses: ./.github/actions/cache
29+
with:
30+
rust_version: ${{ matrix.rust_version }}
2831
- name: Install ${{ matrix.version }} toolchain and clippy
29-
run: rustup install ${{ matrix.version }} && rustup default ${{ matrix.version }} && rustup component add clippy
32+
run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy
3033
- run: cargo clippy --all-targets --all-features -- -D warnings
3134
licensecheck:
3235
runs-on: ubuntu-latest
@@ -58,7 +61,18 @@ jobs:
5861
- name: Checkout sources
5962
uses: actions/checkout@v2
6063
- run: stat LICENSE-3rdparty.yml
61-
- run: cargo install cargo-bundle-licenses
64+
- name: Cache
65+
uses: actions/cache@v3
66+
with:
67+
path: |
68+
~/.cargo/registry/
69+
~/.cargo/git/db/
70+
~/.cargo/bin/
71+
~/.cargo/.crates.toml
72+
# cache key contains current version of cargo-bundle-licenses
73+
# when upstream version is updated we can bump the cache key version, to cache the latest version of the tool
74+
key: "v1-0.5.0"
75+
- run: cargo install cargo-bundle-licenses
6276
- name: "Generate new LICENSE-3rdparty.yml and check against the previous"
6377
env:
6478
CARGO_HOME: "/tmp/dd-cargo"

0 commit comments

Comments
 (0)