Skip to content

Commit 574aee0

Browse files
authored
GH Actions: Replace deprecated actions-rs with direct run: (#422)
These containers spit more deprecation warnings than ever before, and should be replaced with simply invoking `cargo` directly. That's much more relatable for users and all the necessary tools come preinstalled on GitHub's runner images anyway: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#rust-tools `rustup`-like `actions-rs/toolchain` calls are converted to `dtolnay/rust-toolchain` though, as this was already used for MSRV test installs.
1 parent 168529d commit 574aee0

File tree

2 files changed

+69
-89
lines changed

2 files changed

+69
-89
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@ jobs:
1818
- { name: "ndk", target: "armv7-linux-androideabi" }
1919
steps:
2020
- uses: actions/checkout@v2
21-
- uses: actions-rs/toolchain@v1
21+
- uses: dtolnay/rust-toolchain@stable
2222
with:
23-
toolchain: stable
24-
target: ${{ matrix.crate.target }}
25-
override: true
23+
target: aarch64-linux-android
2624
- name: Publish ${{ matrix.crate.name }}
27-
uses: actions-rs/cargo@v1
2825
continue-on-error: true
29-
with:
30-
command: publish
31-
args: --manifest-path ${{ matrix.crate.name }}/Cargo.toml --target ${{ matrix.crate.target }} --token ${{ secrets.cratesio_token }}
26+
run: cargo publish --manifest-path ${{ matrix.crate.name }}/Cargo.toml --target ${{ matrix.crate.target }} --token ${{ secrets.cratesio_token }}

.github/workflows/rust.yml

Lines changed: 66 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6,148 +6,133 @@ jobs:
66
formatting:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions-rs/toolchain@v1
11-
with:
12-
toolchain: stable
13-
override: true
14-
- name: Format
15-
uses: actions-rs/cargo@v1
16-
with:
17-
command: fmt
18-
args: --all -- --check
9+
- uses: actions/checkout@v2
10+
11+
- name: Format
12+
run: cargo fmt --all -- --check
1913

2014
clippy:
2115
runs-on: ubuntu-latest
2216
steps:
23-
- uses: actions/checkout@v2
24-
- uses: actions-rs/toolchain@v1
25-
with:
26-
toolchain: stable
27-
override: true
28-
target: aarch64-linux-android
29-
- name: Clippy
30-
uses: actions-rs/cargo@v1
31-
with:
32-
command: clippy
17+
- uses: actions/checkout@v2
18+
19+
- uses: dtolnay/rust-toolchain@stable
20+
with:
21+
target: aarch64-linux-android
22+
23+
- name: Clippy
3324
# Use a cross-compilation target (that's typical for Android) to lint everything
34-
args: --all --all-targets --all-features --target aarch64-linux-android -- -Dwarnings
25+
run: cargo clippy --all --all-targets --all-features --target aarch64-linux-android -- -Dwarnings
3526

3627
check_ndk_sys_msrv:
3728
name: Check ndk-sys MSRV (1.60.0)
3829
runs-on: ubuntu-latest
3930
steps:
4031
- uses: actions/checkout@v1
32+
4133
- uses: dtolnay/[email protected]
4234
with:
4335
target: aarch64-linux-android
44-
- uses: actions-rs/cargo@v1
45-
with:
46-
command: check
47-
args: -p ndk-sys --all-targets --all-features --target aarch64-linux-android
36+
37+
- name: cargo check
38+
run: cargo check -p ndk-sys --all-targets --all-features --target aarch64-linux-android
4839

4940
check_msrv:
5041
name: Check overall MSRV (1.64.0)
5142
runs-on: ubuntu-latest
5243
steps:
5344
- uses: actions/checkout@v1
45+
5446
- uses: dtolnay/[email protected]
5547
with:
5648
target: aarch64-linux-android
57-
- uses: actions-rs/cargo@v1
58-
with:
59-
command: check
60-
args: --workspace --all-targets --all-features --target aarch64-linux-android
49+
50+
- name: cargo check
51+
run: cargo check --workspace --all-targets --all-features --target aarch64-linux-android
6152

6253
build:
6354
strategy:
6455
fail-fast: false
6556
matrix:
66-
os: [ubuntu-latest]
67-
rust-channel: ['stable', 'nightly']
57+
os: [ubuntu-latest]
58+
rust-channel: [stable, nightly]
6859
rust-target:
69-
- { triple: 'armv7-linux-androideabi', abi: armeabi-v7a }
70-
- { triple: 'aarch64-linux-android', abi: arm64-v8a }
71-
- { triple: 'i686-linux-android', abi: x86 }
72-
- { triple: 'x86_64-linux-android', abi: x86_64 }
60+
- { triple: "armv7-linux-androideabi", abi: armeabi-v7a }
61+
- { triple: "aarch64-linux-android", abi: arm64-v8a }
62+
- { triple: "i686-linux-android", abi: x86 }
63+
- { triple: "x86_64-linux-android", abi: x86_64 }
7364
include:
7465
- os: windows-latest
75-
rust-channel: 'stable'
76-
rust-target: { triple: 'aarch64-linux-android', abi: arm64-v8a }
66+
rust-channel: stable
67+
rust-target: { triple: "aarch64-linux-android", abi: arm64-v8a }
7768
- os: windows-latest
78-
rust-channel: 'stable'
79-
rust-target: { triple: 'x86_64-linux-android', abi: x86_64 }
69+
rust-channel: stable
70+
rust-target: { triple: "x86_64-linux-android", abi: x86_64 }
8071

8172
runs-on: ${{ matrix.os }}
8273
name: Cross-compile
8374

8475
steps:
85-
- uses: actions/checkout@v2
76+
- uses: actions/checkout@v2
8677

87-
- name: Setup Android SDK
88-
uses: android-actions/setup-android@v2
78+
- name: Setup Android SDK
79+
uses: android-actions/setup-android@v2
8980

90-
- name: Install cargo-ndk
91-
run: cargo install cargo-ndk
81+
- name: Install cargo-ndk
82+
run: cargo install cargo-ndk
9283

93-
- name: Installing Rust ${{ matrix.rust-channel }} w/ ${{ matrix.rust-target.triple }}
94-
uses: actions-rs/toolchain@v1
95-
with:
96-
toolchain: ${{ matrix.rust-channel }}
97-
target: ${{ matrix.rust-target.triple }}
98-
override: true
84+
- name: Installing Rust ${{ matrix.rust-channel }} w/ ${{ matrix.rust-target.triple }}
85+
uses: dtolnay/rust-toolchain@master
86+
with:
87+
target: ${{ matrix.rust-target.triple }}
88+
toolchain: ${{ matrix.rust-channel }}
9989

100-
- name: Compile for ${{ matrix.rust-target.triple }}
101-
run: cargo ndk -t ${{ matrix.rust-target.abi }} build
90+
- name: Compile for ${{ matrix.rust-target.triple }}
91+
run: cargo ndk -t ${{ matrix.rust-target.abi }} build
10292

10393
build-host:
10494
strategy:
10595
fail-fast: false
10696
matrix:
107-
os: [ubuntu-latest]
108-
rust-channel: ['stable', 'nightly']
97+
os: [ubuntu-latest]
98+
rust-channel: [stable, nightly]
10999

110100
runs-on: ${{ matrix.os }}
111101
name: Host-side tests
112102

113103
steps:
114-
- uses: actions/checkout@v2
104+
- uses: actions/checkout@v2
115105

116-
- name: Installing Rust ${{ matrix.rust-channel }}
117-
uses: actions-rs/toolchain@v1
118-
with:
119-
toolchain: ${{ matrix.rust-channel }}
120-
override: true
106+
- name: Installing Rust ${{ matrix.rust-channel }}
107+
uses: dtolnay/rust-toolchain@master
108+
with:
109+
toolchain: ${{ matrix.rust-channel }}
121110

122-
- name: Test ndk-sys
123-
run:
124-
cargo test -p ndk-sys --all-features
111+
- name: Test ndk-sys
112+
run: cargo test -p ndk-sys --all-features
125113

126-
- name: Test ndk
127-
run:
128-
cargo test -p ndk --all-features
114+
- name: Test ndk
115+
run: cargo test -p ndk --all-features
129116

130117
docs:
131118
strategy:
132119
fail-fast: false
133120
matrix:
134-
os: [ubuntu-latest]
135-
rust-channel: ['stable', 'nightly']
121+
os: [ubuntu-latest]
122+
rust-channel: [stable, nightly]
136123

137124
runs-on: ${{ matrix.os }}
138125
name: Build-test docs
139126

140127
steps:
141-
- uses: actions/checkout@v2
142-
143-
- name: Installing Rust ${{ matrix.rust-channel }}
144-
uses: actions-rs/toolchain@v1
145-
with:
146-
toolchain: ${{ matrix.rust-channel }}
147-
override: true
148-
149-
- name: Document all crates
150-
env:
151-
RUSTDOCFLAGS: -Dwarnings
152-
run:
153-
cargo doc --all --all-features
128+
- uses: actions/checkout@v2
129+
130+
- name: Installing Rust ${{ matrix.rust-channel }}
131+
uses: dtolnay/rust-toolchain@master
132+
with:
133+
toolchain: ${{ matrix.rust-channel }}
134+
135+
- name: Document all crates
136+
env:
137+
RUSTDOCFLAGS: -Dwarnings
138+
run: cargo doc --all --all-features

0 commit comments

Comments
 (0)