Skip to content

Commit df5c6e6

Browse files
committed
Use native rustup
1 parent bc883c3 commit df5c6e6

File tree

2 files changed

+58
-80
lines changed

2 files changed

+58
-80
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,21 @@ jobs:
1616
# Run cargo fmt --check
1717
style:
1818
name: style
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-22.04
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v2
2323

24-
- name: Install Rust
25-
uses: actions-rs/toolchain@v1
26-
with:
27-
profile: minimal
28-
toolchain: stable
29-
override: true
30-
components: rustfmt
31-
3224
- name: Fail on warnings
3325
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
3426

3527
- name: cargo fmt --check
36-
uses: actions-rs/cargo@v1
37-
with:
38-
command: fmt
39-
args: --all -- --check
28+
run: cargo fmt --all -- --check
4029

4130
# Compilation check
4231
check:
4332
name: check
44-
runs-on: ubuntu-20.04
33+
runs-on: ubuntu-22.04
4534
strategy:
4635
matrix:
4736
target:
@@ -52,57 +41,47 @@ jobs:
5241
- name: Checkout
5342
uses: actions/checkout@v2
5443

55-
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
56-
uses: actions-rs/toolchain@v1
57-
with:
58-
toolchain: ${{ matrix.toolchain }}
59-
target: ${{ matrix.target }}
60-
override: true
44+
- name: Install Rust ${{ matrix.toolchain }}
45+
run: |
46+
rustup set profile minimal
47+
rustup override set ${{ matrix.toolchain }}
48+
49+
- name: Configure Rust target (${{ matrix.target }})
50+
run: rustup target add ${{ matrix.target }}
6151

6252
- name: Fail on warnings
6353
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
6454

6555
- name: Cache Dependencies
66-
uses: Swatinem/rust-cache@v1
56+
uses: Swatinem/rust-cache@v2
6757

6858
- name: cargo check
69-
uses: actions-rs/cargo@v1
70-
with:
71-
use-cross: false
72-
command: check
73-
args: --target=${{ matrix.target }}
59+
run: cargo check --target=${{ matrix.target }}
7460

7561
# Clippy
7662
clippy:
7763
name: Cargo clippy
78-
runs-on: ubuntu-20.04
64+
runs-on: ubuntu-22.04
7965
steps:
8066
- name: Checkout
8167
uses: actions/checkout@v2
8268

83-
- name: Install Rust stable
84-
uses: actions-rs/toolchain@v1
85-
with:
86-
toolchain: stable
87-
target: x86_64-unknown-linux-gnu
88-
override: true
89-
9069
- name: Fail on warnings
9170
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
9271

72+
- name: Add Rust component clippy
73+
run: rustup component add clippy
74+
9375
- name: Cache Dependencies
94-
uses: Swatinem/rust-cache@v1
76+
uses: Swatinem/rust-cache@v2
9577

9678
- name: cargo clippy
97-
uses: actions-rs/cargo@v1
98-
with:
99-
use-cross: false
100-
command: clippy
79+
run: cargo clippy
10180

10281
# Verify all examples
10382
testexamples:
10483
name: testexamples
105-
runs-on: ubuntu-20.04
84+
runs-on: ubuntu-22.04
10685
strategy:
10786
matrix:
10887
target:
@@ -113,29 +92,27 @@ jobs:
11392
- name: Checkout
11493
uses: actions/checkout@v2
11594

116-
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
117-
uses: actions-rs/toolchain@v1
118-
with:
119-
toolchain: ${{ matrix.toolchain }}
120-
target: ${{ matrix.target }}
121-
override: true
95+
- name: Install Rust ${{ matrix.toolchain }}
96+
run: |
97+
rustup set profile minimal
98+
rustup override set ${{ matrix.toolchain }}
99+
100+
- name: Configure Rust target (${{ matrix.target }})
101+
run: rustup target add ${{ matrix.target }}
122102

123103
- name: Cache Dependencies
124-
uses: Swatinem/rust-cache@v1
104+
uses: Swatinem/rust-cache@v2
125105

126106
- name: Fail on warnings
127107
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
128108

129-
- uses: actions-rs/cargo@v1
130-
with:
131-
use-cross: false
132-
command: test
133-
args: --examples
109+
- name: cargo test --test ui
110+
run: cargo test --examples
134111

135112
# Run test suite for UI
136113
testui:
137114
name: testui
138-
runs-on: ubuntu-20.04
115+
runs-on: ubuntu-22.04
139116
strategy:
140117
matrix:
141118
target:
@@ -146,52 +123,51 @@ jobs:
146123
- name: Checkout
147124
uses: actions/checkout@v2
148125

149-
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
150-
uses: actions-rs/toolchain@v1
151-
with:
152-
toolchain: ${{ matrix.toolchain }}
153-
target: ${{ matrix.target }}
154-
override: true
126+
- name: Install Rust ${{ matrix.toolchain }}
127+
run: |
128+
rustup set profile minimal
129+
rustup override set ${{ matrix.toolchain }}
130+
131+
- name: Configure Rust target (${{ matrix.target }})
132+
run: rustup target add ${{ matrix.target }}
155133

156134
- name: Cache Dependencies
157-
uses: Swatinem/rust-cache@v1
135+
uses: Swatinem/rust-cache@v2
158136

159137
- name: Fail on warnings
160138
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
161139

162-
163-
- uses: actions-rs/cargo@v1
164-
with:
165-
use-cross: false
166-
command: test
167-
args: --test ui
140+
- name: cargo test --test ui
141+
run: cargo test --test ui
168142

169143
# Run test suite
170144
test:
171145
name: test
172-
runs-on: ubuntu-20.04
146+
runs-on: ubuntu-22.04
147+
strategy:
148+
matrix:
149+
target:
150+
- thumbv7m-none-eabi
151+
toolchain:
152+
- stable
153+
173154
steps:
174155
- name: Checkout
175156
uses: actions/checkout@v2
176157

177-
- name: Install Rust
178-
uses: actions-rs/toolchain@v1
179-
with:
180-
toolchain: stable
181-
target: thumbv7m-none-eabi
182-
override: true
158+
- name: Install Rust ${{ matrix.toolchain }}
159+
run: |
160+
rustup set profile minimal
161+
rustup override set ${{ matrix.toolchain }}
183162
184163
- name: Cache Dependencies
185-
uses: Swatinem/rust-cache@v1
164+
uses: Swatinem/rust-cache@v2
186165

187166
- name: Fail on warnings
188167
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
189168

190-
- uses: actions-rs/cargo@v1
191-
with:
192-
use-cross: false
193-
command: test
194-
args: --lib
169+
- name: cargo test --test ui
170+
run: cargo test --lib
195171

196172
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
197173
#
@@ -207,7 +183,7 @@ jobs:
207183
- testexamples
208184
- test
209185
- testui
210-
runs-on: ubuntu-20.04
186+
runs-on: ubuntu-22.04
211187
steps:
212188
- name: Mark the job as a success
213189
run: exit 0

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Changed
1111

12+
- CI: Use native Rustup
13+
1214
### Fixed
1315

1416
## [v1.0.2] - 2022-06-19

0 commit comments

Comments
 (0)