Skip to content

Commit

Permalink
ci: Replace unmaintained actions-rs GH actions
Browse files Browse the repository at this point in the history
[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](actions-rs/clippy-check#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.
  • Loading branch information
groszewn committed Jan 19, 2023
1 parent 23b8e25 commit 204b417
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 --all-targets --manifest-path tensorboard/data/server/Cargo.toml --fix` to fix all Clippy complaints.
run: cargo clippy --all-targets --manifest-path tensorboard/data/server/Cargo.toml -- -D warnings
- name: 'Check cargo-raze freshness'
run: |
rm -rf third_party/rust/
Expand Down

0 comments on commit 204b417

Please sign in to comment.