Skip to content

Commit 2179951

Browse files
authored
Replace actions-rs with rustup (#198)
* 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 761c59a commit 2179951

File tree

10 files changed

+1136
-1188
lines changed

10 files changed

+1136
-1188
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-74
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,38 +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 }}
148-
# uses: ./.github/actions/linux-x86_64-musl/
149-
# if: matrix.cross
150-
# with:
151-
# args: cross build -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 }}
152103

153104
- name: Build for Linux
154105
uses: ./.github/actions/linux-x86_64-musl/
@@ -169,11 +120,7 @@ jobs:
169120
test-directory: ./lib/${{ matrix.wasm-dirctory }}/tests
170121
steps:
171122
- uses: actions/checkout@v4
172-
- uses: actions-rs/toolchain@v1
173-
with:
174-
profile: minimal
175-
toolchain: stable
176-
override: true
123+
- run: rustup toolchain install stable --profile minimal --no-self-update
177124

178125
- name: Create the Web Assembly
179126
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
@@ -118,34 +118,21 @@ jobs:
118118
sudo apt update
119119
sudo apt install ${{ matrix.linker }}
120120
121+
- run: rustup toolchain install stable --profile minimal --no-self-update
122+
# TODO: Consider https://github.com/Swatinem/rust-cache for caching of dependencies
123+
121124
- name: Build for non-Linux # Windows and MacOS
122-
uses: actions-rs/toolchain@v1
123-
if: matrix.os != 'ubuntu-latest'
124-
with:
125-
profile: minimal
126-
toolchain: stable
127-
override: true
128-
- uses: actions-rs/cargo@v1
129125
if: matrix.os != 'ubuntu-latest'
130-
with:
131-
command: build
132-
args: -q --release
126+
run: cargo build -q --release
133127

134-
# https://github.com/actions-rs/cargo#cross-compilation
135-
- name: Build with cross # ARM builds
136-
uses: actions-rs/toolchain@v1
128+
- run: rustup target add ${{ matrix.target }} --toolchain stable
137129
if: matrix.cross
138-
with:
139-
profile: minimal
140-
toolchain: stable
141-
target: ${{ matrix.target }}
142-
override: true
143-
- uses: actions-rs/cargo@v1
130+
- run: cargo install cross
144131
if: matrix.cross
145-
with:
146-
use-cross: true
147-
command: build
148-
args: -q --release --target ${{ matrix.target }}
132+
133+
- name: Build with cross # ARM builds
134+
if: matrix.cross
135+
run: cross build -q --release --target ${{ matrix.target }}
149136

150137
- name: Build for Linux
151138
uses: ./.github/actions/linux-x86_64-musl/
@@ -228,11 +215,9 @@ jobs:
228215
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
229216
working-directory: ${{env.working-directory}}
230217

231-
- uses: actions-rs/toolchain@v1
232-
with:
233-
profile: minimal
234-
toolchain: stable
235-
override: true
218+
- run: rustup toolchain install stable --profile minimal --no-self-update
219+
- run: rustup target add wasm32-unknown-unknown --toolchain stable
220+
236221
- name: Create the Web Assembly
237222
id: wasm_pack
238223
run: |
@@ -300,11 +285,9 @@ jobs:
300285
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
301286
working-directory: ${{env.working-directory}}
302287

303-
- uses: actions-rs/toolchain@v1
304-
with:
305-
profile: minimal
306-
toolchain: stable
307-
override: true
288+
- run: rustup toolchain install stable --profile minimal --no-self-update
289+
- run: rustup target add wasm32-unknown-unknown --toolchain stable
290+
308291
- name: Create the Web Assembly
309292
id: wasm_pack
310293
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)