Skip to content

Commit fbf3e64

Browse files
authored
Replace actions-rs with rustup (#198) (#199)
* Updated dependencies * Attempt to replace actions-rs with rustup - actions-rs/toolchain#216 (comment) - Rustup is now available on default github runners, switch to using it. Consider https://github.com/Swatinem/rust-cache in the future * Removed some missed actions-rs lines * Added install of cross * Updated additional github actions to remove actions-rs - Updated lock files to trigger github actions * Moved dockerfile to Ubuntu 22.04 * Rolled back docker update due to missing packages
1 parent c32d46c commit fbf3e64

File tree

10 files changed

+1178
-1226
lines changed

10 files changed

+1178
-1226
lines changed

.github/actions/linux-x86_64-musl/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Modified from https://github.com/emk/rust-musl-builder/blob/a980e27da6c6b629301844637e6139053a49e842/Dockerfile
2-
# Use Ubuntu 18.04 LTS as our base image.
2+
# Use Ubuntu 20.04 LTS as our base image.
33
FROM ubuntu:20.04
44

55
# for libressl

.github/workflows/pr-guide.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Add Rust toolchain
22-
uses: actions-rs/toolchain@v1
23-
with:
24-
profile: minimal
25-
target: wasm32-unknown-unknown
26-
toolchain: stable
27-
override: true
22+
run: rustup toolchain install stable --profile minimal --no-self-update
23+
- run: rustup target add wasm32-unknown-unknown --toolchain stable
2824
- name: Add Node.js toolchain ${{ matrix.node-version }}
2925
uses: actions/setup-node@v4
3026
with:

.github/workflows/pr-ppaas.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929
- name: Add Rust toolchain
30-
uses: actions-rs/toolchain@v1
31-
with:
32-
profile: minimal
33-
target: wasm32-unknown-unknown
34-
toolchain: stable
35-
override: true
30+
run: rustup toolchain install stable --profile minimal --no-self-update
31+
- run: rustup target add wasm32-unknown-unknown --toolchain stable
3632
- name: Add Node.js toolchain ${{ matrix.node-version }}
3733
uses: actions/setup-node@v4
3834
with:

.github/workflows/pr-rust.yml

+21-70
Original file line numberDiff line numberDiff line change
@@ -16,66 +16,34 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- uses: actions/checkout@v4
19-
- uses: actions-rs/toolchain@v1
20-
with:
21-
profile: minimal
22-
toolchain: stable
23-
override: true
24-
- uses: actions-rs/cargo@v1
25-
with:
26-
command: test
27-
args: --all
19+
- run: rustup toolchain install stable --profile minimal --no-self-update
20+
- run: cargo test --all
2821

2922
fmt:
3023
name: Rustfmt
3124
runs-on: ubuntu-latest
3225
steps:
3326
- uses: actions/checkout@v4
34-
- uses: actions-rs/toolchain@v1
35-
with:
36-
profile: minimal
37-
toolchain: stable
38-
override: true
39-
components: rustfmt
40-
- uses: actions-rs/cargo@v1
41-
with:
42-
command: fmt
43-
args: --all -- --check
27+
- run: rustup toolchain install stable --profile minimal --no-self-update
28+
- run: cargo fmt --all -- --check
4429

4530
clippy:
4631
name: Clippy
4732
runs-on: ubuntu-latest
4833
steps:
4934
- uses: actions/checkout@v4
50-
- uses: actions-rs/toolchain@v1
51-
with:
52-
profile: minimal
53-
toolchain: stable
54-
override: true
55-
components: clippy
56-
- uses: actions-rs/cargo@v1
57-
with:
58-
command: clippy
59-
args: --all -- -D warnings
35+
- run: rustup toolchain install stable --profile minimal --no-self-update
36+
- run: rustup component add clippy
37+
- run: cargo clippy --all -- -D warnings
6038

6139
deny:
6240
name: Cargo Deny
6341
runs-on: ubuntu-latest
6442
steps:
6543
- uses: actions/checkout@v4
66-
- uses: actions-rs/toolchain@v1
67-
with:
68-
profile: minimal
69-
toolchain: stable
70-
override: true
71-
- uses: actions-rs/cargo@v1
72-
with:
73-
command: install
74-
args: cargo-deny
75-
- uses: actions-rs/cargo@v1
76-
with:
77-
command: deny
78-
args: check --hide-inclusion-graph license sources advisories
44+
- run: rustup toolchain install stable --profile minimal --no-self-update
45+
- run: cargo install cargo-deny --locked
46+
- run: cargo deny check --hide-inclusion-graph license sources advisories
7947

8048
build:
8149
name: Build
@@ -117,34 +85,21 @@ jobs:
11785
sudo apt update
11886
sudo apt install ${{ matrix.linker }}
11987
88+
- run: rustup toolchain install stable --profile minimal --no-self-update
89+
# TODO: Consider https://github.com/Swatinem/rust-cache for caching of dependencies
90+
12091
- name: Build for non-Linux # Windows and MacOS
121-
uses: actions-rs/toolchain@v1
12292
if: matrix.os != 'ubuntu-latest'
123-
with:
124-
profile: minimal
125-
toolchain: stable
126-
override: true
127-
- uses: actions-rs/cargo@v1
128-
if: matrix.os != 'ubuntu-latest'
129-
with:
130-
command: build
131-
args: -q --release
93+
run: cargo build -q --release
13294

133-
# https://github.com/actions-rs/cargo#cross-compilation
134-
- name: Build with cross # ARM builds
135-
uses: actions-rs/toolchain@v1
95+
- run: rustup target add ${{ matrix.target }} --toolchain stable
13696
if: matrix.cross
137-
with:
138-
profile: minimal
139-
toolchain: stable
140-
target: ${{ matrix.target }}
141-
override: true
142-
- uses: actions-rs/cargo@v1
97+
- run: cargo install cross
14398
if: matrix.cross
144-
with:
145-
use-cross: true
146-
command: build
147-
args: -q --release --target ${{ matrix.target }}
99+
100+
- name: Build with cross # ARM builds
101+
if: matrix.cross
102+
run: cross build -q --release --target ${{ matrix.target }}
148103

149104
- name: Build for Linux
150105
uses: ./.github/actions/linux-x86_64-musl/
@@ -177,11 +132,7 @@ jobs:
177132
test-directory: ./lib/${{ matrix.wasm-dirctory }}/tests
178133
steps:
179134
- uses: actions/checkout@v4
180-
- uses: actions-rs/toolchain@v1
181-
with:
182-
profile: minimal
183-
toolchain: stable
184-
override: true
135+
- run: rustup toolchain install stable --profile minimal --no-self-update
185136

186137
- name: Create the Web Assembly
187138
id: wasm_pack

.github/workflows/release-test-server.yml

+10-23
Original file line numberDiff line numberDiff line change
@@ -104,34 +104,21 @@ jobs:
104104
sudo apt update
105105
sudo apt install ${{ matrix.linker }}
106106
107+
- run: rustup toolchain install stable --profile minimal --no-self-update
108+
# TODO: Consider https://github.com/Swatinem/rust-cache for caching of dependencies
109+
107110
- name: Build for non-Linux # Windows and MacOS
108-
uses: actions-rs/toolchain@v1
109-
if: matrix.os != 'ubuntu-latest'
110-
with:
111-
profile: minimal
112-
toolchain: stable
113-
override: true
114-
- uses: actions-rs/cargo@v1
115111
if: matrix.os != 'ubuntu-latest'
116-
with:
117-
command: build
118-
args: -q --release --bin test-server
112+
run: cargo build -q --release --bin test-server
113+
114+
- run: rustup target add ${{ matrix.target }} --toolchain stable
115+
if: matrix.cross
116+
- run: cargo install cross
117+
if: matrix.cross
119118

120-
# https://github.com/actions-rs/cargo#cross-compilation
121119
- name: Build with cross # ARM builds
122-
uses: actions-rs/toolchain@v1
123120
if: matrix.os == 'ubuntu-latest'
124-
with:
125-
profile: minimal
126-
toolchain: stable
127-
target: ${{ matrix.target }}
128-
override: true
129-
- uses: actions-rs/cargo@v1
130-
if: matrix.os == 'ubuntu-latest'
131-
with:
132-
use-cross: true
133-
command: build
134-
args: -q --release --target ${{ matrix.target }} --bin test-server
121+
run: cross build -q --release --target ${{ matrix.target }} --bin test-server
135122

136123
- name: Compress for Linux/Arm
137124
if: matrix.os == 'ubuntu-latest'

.github/workflows/release.yml

+16-33
Original file line numberDiff line numberDiff line change
@@ -124,34 +124,21 @@ jobs:
124124
sudo apt update
125125
sudo apt install ${{ matrix.linker }}
126126
127+
- run: rustup toolchain install stable --profile minimal --no-self-update
128+
# TODO: Consider https://github.com/Swatinem/rust-cache for caching of dependencies
129+
127130
- name: Build for non-Linux # Windows and MacOS
128-
uses: actions-rs/toolchain@v1
129-
if: matrix.os != 'ubuntu-latest'
130-
with:
131-
profile: minimal
132-
toolchain: stable
133-
override: true
134-
- uses: actions-rs/cargo@v1
135131
if: matrix.os != 'ubuntu-latest'
136-
with:
137-
command: build
138-
args: -q --release ${{ matrix.build_param }} ${{ matrix.binary }}
132+
run: cargo build -q --release ${{ matrix.build_param }} ${{ matrix.binary }}
139133

140-
# https://github.com/actions-rs/cargo#cross-compilation
141-
- name: Build with cross # ARM builds
142-
uses: actions-rs/toolchain@v1
134+
- run: rustup target add ${{ matrix.target }} --toolchain stable
143135
if: matrix.cross
144-
with:
145-
profile: minimal
146-
toolchain: stable
147-
target: ${{ matrix.target }}
148-
override: true
149-
- uses: actions-rs/cargo@v1
136+
- run: cargo install cross
150137
if: matrix.cross
151-
with:
152-
use-cross: true
153-
command: build
154-
args: -q --release ${{ matrix.build_param }} ${{ matrix.binary }} --target ${{ matrix.target }}
138+
139+
- name: Build with cross # ARM builds
140+
if: matrix.cross
141+
run: cross build -q --release ${{ matrix.build_param }} ${{ matrix.binary }} --target ${{ matrix.target }}
155142

156143
- name: Build for Linux
157144
uses: ./.github/actions/linux-x86_64-musl/
@@ -242,11 +229,9 @@ jobs:
242229
echo "Cargo $(grep "^version =" Cargo.toml )"
243230
working-directory: ${{env.working-directory}}
244231

245-
- uses: actions-rs/toolchain@v1
246-
with:
247-
profile: minimal
248-
toolchain: stable
249-
override: true
232+
- run: rustup toolchain install stable --profile minimal --no-self-update
233+
- run: rustup target add wasm32-unknown-unknown --toolchain stable
234+
250235
- name: Create the Web Assembly
251236
id: wasm_pack
252237
run: |
@@ -324,11 +309,9 @@ jobs:
324309
echo "Cargo $(grep "^version =" Cargo.toml )"
325310
working-directory: ${{env.working-directory}}
326311

327-
- uses: actions-rs/toolchain@v1
328-
with:
329-
profile: minimal
330-
toolchain: stable
331-
override: true
312+
- run: rustup toolchain install stable --profile minimal --no-self-update
313+
- run: rustup target add wasm32-unknown-unknown --toolchain stable
314+
332315
- name: Create the Web Assembly
333316
id: wasm_pack
334317
run: |

.github/workflows/update-guide.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Add Rust toolchain
14-
uses: actions-rs/toolchain@v1
15-
with:
16-
profile: minimal
17-
target: wasm32-unknown-unknown
18-
toolchain: stable
19-
override: true
14+
run: rustup toolchain install stable --profile minimal --no-self-update
15+
- run: rustup target add wasm32-unknown-unknown --toolchain stable
2016
- name: Add Node.js toolchain
2117
uses: actions/setup-node@v4
2218
with:

0 commit comments

Comments
 (0)