Skip to content

Commit

Permalink
ci: Avoid actions from actions-rs
Browse files Browse the repository at this point in the history
They aren't maintained all that well from what I can tell. In addition
this reduces the risk of issues due to buggy updates. Supply chain
attacks have already been mitigated using the permissions: {} key.

Only the official GitHub checkout action is kept.

Remove cargo-fmt binaries that may already be installed, which makes
`rustup update` print warnings.

Signed-off-by: Björn Roy Baron <[email protected]>
Co-authored-by: Mickaël Salaün <[email protected]>
Signed-off-by: Mickaël Salaün <[email protected]>
  • Loading branch information
bjorn3 and l0kod committed Jan 26, 2023
1 parent 99628b1 commit f69888f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 53 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ jobs:
- uses: actions/checkout@v3

- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default stable
rustup update
- name: Build documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
run: rustup run stable cargo doc --no-deps

- name: Add index
run: |
Expand Down
66 changes: 21 additions & 45 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ jobs:
- uses: actions/checkout@v3

- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default stable
rustup update
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
run: rustup run stable cargo test --verbose

ubuntu_20_rust_stable:
runs-on: ubuntu-20.04
Expand All @@ -43,47 +40,29 @@ jobs:
- uses: actions/checkout@v3

- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default stable
rustup component add rustfmt clippy
rustup update
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
run: rustup run stable cargo build --verbose

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
run: rustup run stable cargo test --verbose

- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: rustup run stable cargo fmt --all -- --check

- name: Check source with Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- --deny warnings
run: rustup run stable cargo clippy -- --deny warnings

- name: Check tests with Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests -- --deny warnings
run: rustup run stable cargo clippy --tests -- --deny warnings

- name: Check documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
run: rustup run stable cargo doc --no-deps

ubuntu_22_rust_stable:
runs-on: ubuntu-22.04
Expand All @@ -93,13 +72,10 @@ jobs:
- uses: actions/checkout@v3

- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default stable
rustup update
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
run: rustup run stable cargo test --verbose

0 comments on commit f69888f

Please sign in to comment.