Skip to content

Commit 890786b

Browse files
authored
CI: Replace unnecessary actions-rs steps with direct run: cargo ... (#187)
GitHub Actions' `runner-images` already come fully loaded with all the Rust tools that we need [1]: remove the bloated and outdated `actions-rs/toolchain` setup step for that, and also remove the `actions-rs/cargo` action that only serves as a more convoluted way to run simple `cargo` shell commands. Besides, `actions-rs` are unmaintained and outdated, and throw an alarming number of spammy warnings in CI build output. [1]: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#rust-tools
1 parent 22aa817 commit 890786b

File tree

2 files changed

+13
-70
lines changed

2 files changed

+13
-70
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,8 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
steps:
1717
- uses: actions/checkout@v4
18-
- uses: actions-rs/toolchain@v1
19-
with:
20-
profile: minimal
21-
toolchain: stable
22-
override: true
23-
- uses: actions-rs/cargo@v1
24-
with:
25-
command: check
26-
args: --workspace --all-targets --features ${{ matrix.features }} --no-default-features
18+
- name: Cargo check
19+
run: cargo check --workspace --all-targets --features ${{ matrix.features }} --no-default-features
2720

2821
test:
2922
name: Test Suite
@@ -37,37 +30,18 @@ jobs:
3730
runs-on: ${{ matrix.os }}
3831
steps:
3932
- uses: actions/checkout@v4
40-
- uses: actions-rs/toolchain@v1
41-
with:
42-
profile: minimal
43-
toolchain: stable
44-
override: true
45-
- name: Test all targets
46-
uses: actions-rs/cargo@v1
47-
with:
48-
command: test
49-
args: --workspace --all-targets --features ${{ matrix.features }} --no-default-features
50-
- name: Test docs
51-
uses: actions-rs/cargo@v1
52-
with:
53-
command: test
54-
args: --workspace --doc --features ${{ matrix.features }} --no-default-features
33+
- name: Cargo test all targets
34+
run: cargo test --workspace --all-targets --features ${{ matrix.features }} --no-default-features
35+
- name: Cargo test docs
36+
run: cargo test --workspace --doc --features ${{ matrix.features }} --no-default-features
5537

5638
fmt:
5739
name: Rustfmt
5840
runs-on: ubuntu-latest
5941
steps:
6042
- uses: actions/checkout@v4
61-
- uses: actions-rs/toolchain@v1
62-
with:
63-
profile: minimal
64-
toolchain: stable
65-
override: true
66-
components: rustfmt
67-
- uses: actions-rs/cargo@v1
68-
with:
69-
command: fmt
70-
args: --all -- --check
43+
- name: Cargo fmt
44+
run: cargo fmt --all -- --check
7145

7246
clippy:
7347
name: Clippy
@@ -81,16 +55,8 @@ jobs:
8155
runs-on: ${{ matrix.os }}
8256
steps:
8357
- uses: actions/checkout@v4
84-
- uses: actions-rs/toolchain@v1
85-
with:
86-
profile: minimal
87-
toolchain: stable
88-
override: true
89-
components: clippy
90-
- uses: actions-rs/cargo@v1
91-
with:
92-
command: clippy
93-
args: --workspace --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
58+
- name: Cargo clippy
59+
run: cargo clippy --workspace --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
9460

9561
doc:
9662
name: Build documentation
@@ -100,26 +66,13 @@ jobs:
10066
RUSTDOCFLAGS: -Dwarnings
10167
steps:
10268
- uses: actions/checkout@v4
103-
- uses: actions-rs/toolchain@v1
104-
with:
105-
profile: minimal
106-
toolchain: stable
107-
override: true
10869
- name: Build documentation
109-
uses: actions-rs/cargo@v1
110-
with:
111-
command: doc
112-
args: --no-deps --workspace --all-features --document-private-items
70+
run: cargo doc --no-deps --workspace --all-features --document-private-items
11371

11472
readme:
11573
runs-on: ubuntu-latest
11674
steps:
11775
- uses: actions/checkout@v4
118-
- uses: actions-rs/toolchain@v1
119-
with:
120-
profile: minimal
121-
toolchain: stable
122-
override: true
12376
- name: Use cached cargo-readme
12477
uses: actions/cache@v3
12578
id: cargo-readme-cache
@@ -128,10 +81,7 @@ jobs:
12881
key: ${{ runner.os }}-cargo-readme
12982
- name: Install cargo-readme
13083
if: steps.cargo-readme-cache.outputs.cache-hit != 'true'
131-
uses: actions-rs/cargo@v1
132-
with:
133-
command: install
134-
args: cargo-readme
84+
run: cargo install cargo-readme
13585
- name: Check if README.md is up-to-date
13686
run: |
13787
cargo readme > README.md

.github/workflows/publish.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,5 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: actions-rs/toolchain@v1
15-
with:
16-
toolchain: stable
17-
override: true
1814
- name: Publish
19-
uses: actions-rs/cargo@v1
20-
with:
21-
command: publish
22-
args: --token ${{ secrets.cratesio_token }}
15+
run: cargo publish --token ${{ secrets.cratesio_token }}

0 commit comments

Comments
 (0)