From ac6f55f2bf1abe199d8adfbb18bec481e246ac2b Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Wed, 26 Jul 2023 00:16:17 -0700 Subject: [PATCH 1/3] Add a clippy job --- .github/workflows/rust.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8debeeda44..5344c51378 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,3 +76,28 @@ jobs: raco pkg install --auto || raco setup forge - name: Run Tests run: cargo test --test external_annotation_tests + linting: + name: Clippy + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + # just triggers rustup to download the toolchain + - name: Cache Toolchain + uses: actions/cache@v3 + with: + path: ~/.rustup + key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain.toml') }} + - name: Cache Dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-rust-deps-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} + - name: Clippy + run: cargo clippy --all -- -D warnings \ No newline at end of file From c530805ca56ae5f91caeaf604e7dcd3e4c9934a2 Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Wed, 26 Jul 2023 11:04:04 -0700 Subject: [PATCH 2/3] Adding missing steps --- .github/workflows/rust.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0716512891..325bdbdb06 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -97,6 +97,12 @@ jobs: name: Clippy runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + - name: Cache Toolchain + uses: actions/cache@v3 + with: + path: ~/.rustup + key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain.toml') }} - name: Cache Dependencies uses: actions/cache@v3 with: From 85c8644fa7fe738a800b18cae5ce60666fb8bade Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Wed, 26 Jul 2023 11:10:42 -0700 Subject: [PATCH 3/3] Need the component --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ec60f6d59a..6d3133114b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] channel = "nightly-2023-04-12" -components = ["rustc-dev", "rust-src", "rustfmt"] +components = ["rustc-dev", "rust-src", "rustfmt", "clippy"] # You are probably looking at this because you got an error that the toolchain # that was configured does not exist,