Skip to content

Commit

Permalink
fix nightly lints surprise build breakage (#51)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
pawelchcki authored Sep 28, 2022
1 parent bef75ac commit 48ad681
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/actions/cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ runs:
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/
~/.cargo/git/db/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/bin/
target/
key: v1-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ inputs.rust_version }}-${{ inputs.build_profile }}
key: v1-${{ runner.os }}-cargo-${{ inputs.rust_version }}-${{ hashFiles('**/Cargo.toml') }}-${{ inputs.build_profile }}
restore-keys: |
v1-${{ runner.os }}-cargo-${{ inputs.rust_version }}-${{ hashFiles('**/Cargo.toml') }}-
v1-${{ runner.os }}-cargo-${{ inputs.rust_version }}-
22 changes: 18 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ jobs:
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- run: cargo fmt --all -- --check
clippy:
name: "clippy #${{ matrix.version }}"
name: "clippy #${{ matrix.rust_version }}"
strategy:
fail-fast: false
matrix:
version: [nightly, "1.60"]
rust_version: ["nightly", "1.60.0", "stable"]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache
uses: ./.github/actions/cache
with:
rust_version: ${{ matrix.rust_version }}
- name: Install ${{ matrix.version }} toolchain and clippy
run: rustup install ${{ matrix.version }} && rustup default ${{ matrix.version }} && rustup component add clippy
run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
licensecheck:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -58,7 +61,18 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2
- run: stat LICENSE-3rdparty.yml
- run: cargo install cargo-bundle-licenses
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/
~/.cargo/git/db/
~/.cargo/bin/
~/.cargo/.crates.toml
# cache key contains current version of cargo-bundle-licenses
# when upstream version is updated we can bump the cache key version, to cache the latest version of the tool
key: "v1-0.5.0"
- run: cargo install cargo-bundle-licenses
- name: "Generate new LICENSE-3rdparty.yml and check against the previous"
env:
CARGO_HOME: "/tmp/dd-cargo"
Expand Down

0 comments on commit 48ad681

Please sign in to comment.