From e2bab2bd728449271607357142a6864379cd4a41 Mon Sep 17 00:00:00 2001 From: Nick Groszewski Date: Thu, 19 Jan 2023 12:45:10 +0000 Subject: [PATCH] ci: Replace unmaintained actions-rs GH actions [actions-rs/toolchain](https://github.com/actions-rs/toolchain) and [actions-rs/clippy-check](https://github.com/actions-rs/clippy-check) have not been updated in the last two years. There are multiple GH action warnings coming from our usage of these actions (Node.js version, `save-state`, `set-output`), so we need to replace these. [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) is maintained and is roughly a drop-in replacement (modulo one of two arguments to the action itself). `clippy-check` seems to have been generally broken for us, since it [can't post lints as annotations back to the PR if it comes from a fork](https://github.com/actions-rs/clippy-check/issues/2) (which most of our PRs do). Instead, we can simply define the `cargo clippy` command directly in our action and make sure we fail on any raised warnings. --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79f12686f9..fe4c3c5638 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,10 +166,9 @@ jobs: key: build-data-server-pip-${{ runner.os }}-cargo-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock', '.github/workflows/ci.yml') }} - name: 'Install Rust toolchain' if: matrix.mode == 'native' - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af + uses: dtolnay/rust-toolchain@5f2e2a7aff63d8cbdacb4832218a30fa7a37ee6e # current HEAD as of 1/19/2023 with: toolchain: ${{ matrix.rust_version }} - default: true components: rustfmt - name: 'Install Python packaging deps' run: | @@ -283,20 +282,17 @@ jobs: ~/.cargo/.crates2.json key: lint-rust-${{ runner.os }}-cargo-${{ matrix.rust_version }}-${{ matrix.cargo_raze_version }}-${{ hashFiles('**/Cargo.lock', '.github/workflows/ci.yml') }} - name: 'Install Rust toolchain' - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af + uses: dtolnay/rust-toolchain@5f2e2a7aff63d8cbdacb4832218a30fa7a37ee6e # current HEAD as of 1/19/2023 with: toolchain: ${{ matrix.rust_version }} - default: true components: rustfmt, clippy - name: 'Install cargo-raze' run: cargo install cargo-raze --version ${{ matrix.cargo_raze_version }} - name: 'Run Rustfmt' run: (cd tensorboard/data/server/ && cargo fmt -- --check) - name: 'Run Clippy' - uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --tests --manifest-path tensorboard/data/server/Cargo.toml + # You can run `cargo clippy --tests --manifest-path --fix` to fix all Clippy complaints. + run: cargo clippy --tests --manifest-path tensorboard/data/server/Cargo.toml -- -D warnings - name: 'Check cargo-raze freshness' run: | rm -rf third_party/rust/