Skip to content

Commit 7bb9236

Browse files
authored
Run cargo/rustup directly in CI (#2)
This is to fix warnings that pop up in Github Actions due to actions-rs/cargo and actions-rs/toolchain not being updated to the Node 16. actions-rs/cargo - [Node.js 12 actions are deprecated. Please use Node.js 16](actions-rs/cargo#216) actions-rs/toolchain - [Node.JS 12 deprecation on GitHub Actions](actions-rs/toolchain#219)
2 parents afb428f + 87eaf20 commit 7bb9236

File tree

1 file changed

+23
-102
lines changed

1 file changed

+23
-102
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,11 @@ jobs:
3131
- name: "Checkout"
3232
uses: actions/checkout@v3
3333

34-
- name: "Cargo Check"
35-
uses: actions-rs/[email protected]
36-
with:
37-
command: check
38-
args: --no-default-features --features ${{ matrix.features }}
34+
- name: "Check for compiler errors"
35+
run: cargo check --no-default-features --features ${{ matrix.features }}
3936

40-
- name: "Linting"
41-
uses: actions-rs/[email protected]
42-
with:
43-
command: clippy
44-
args: --no-default-features --features ${{ matrix.features }} -- -D warnings
37+
- name: "Run linter"
38+
run: cargo clippy --no-default-features --features ${{ matrix.features }} -- -D warnings
4539

4640
formatting_check:
4741
needs: code_quality_check
@@ -50,18 +44,11 @@ jobs:
5044
- name: "Checkout"
5145
uses: actions/checkout@v3
5246

53-
- name: "Set Nightly Rust Toolchain"
54-
uses: "actions-rs/toolchain@v1"
55-
with:
56-
toolchain: nightly
57-
override: true
58-
components: rustfmt
47+
- name: "Install the nightly Rust toolchain"
48+
run: rustup toolchain install nightly -c rustfmt
5949

60-
- name: "Formatting Check"
61-
uses: actions-rs/[email protected]
62-
with:
63-
command: fmt
64-
args: --check
50+
- name: "Check formatting"
51+
run: cargo +nightly fmt --check
6552

6653
dependancy_audit:
6754
needs: formatting_check
@@ -70,10 +57,8 @@ jobs:
7057
- name: "Checkout"
7158
uses: actions/checkout@v3
7259

73-
- name: "Audit"
74-
uses: actions-rs/[email protected]
75-
with:
76-
command: audit
60+
- name: "Audit dependancies"
61+
run: cargo audit
7762

7863
test_suite:
7964
needs: [code_quality_check, formatting_check]
@@ -108,11 +93,8 @@ jobs:
10893
- name: "Checkout"
10994
uses: actions/checkout@v3
11095

111-
- name: "Cargo Test"
112-
uses: actions-rs/[email protected]
113-
with:
114-
command: test
115-
args: --no-default-features --features ${{ matrix.features }} --no-fail-fast
96+
- name: "Run tests"
97+
run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast
11698

11799
os_compat_nix:
118100
needs: test_suite
@@ -132,17 +114,8 @@ jobs:
132114
- name: "Checkout"
133115
uses: actions/checkout@v3
134116

135-
- name: "Cargo Build"
136-
uses: actions-rs/[email protected]
137-
with:
138-
command: build
139-
args: --no-default-features --features ${{ matrix.features }}
140-
141-
- name: "Cargo Test"
142-
uses: actions-rs/[email protected]
143-
with:
144-
command: test
145-
args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
117+
- name: "Run HTTP test"
118+
run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
146119

147120
os_compat_win-msvc:
148121
needs: test_suite
@@ -157,17 +130,8 @@ jobs:
157130
- name: "Checkout"
158131
uses: actions/checkout@v3
159132

160-
- name: "Cargo Build"
161-
uses: actions-rs/[email protected]
162-
with:
163-
command: build
164-
args: --no-default-features --features ${{ matrix.features }}
165-
166-
- name: "Cargo Test"
167-
uses: actions-rs/[email protected]
168-
with:
169-
command: test
170-
args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
133+
- name: "Run HTTP test"
134+
run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
171135

172136
os_compat_win_gnu:
173137
needs: test_suite
@@ -179,26 +143,14 @@ jobs:
179143
- "rustcrypto,rustls-tls"
180144
runs-on: windows-latest
181145
steps:
182-
- name: "Set GNU Rust Toolchain"
183-
uses: "actions-rs/toolchain@v1"
184-
with:
185-
toolchain: stable-x86_64-pc-windows-gnu
186-
override: true
146+
- name: "Install the stable GNU Rust toolchain"
147+
run: rustup toolchain install stable-gnu
187148

188149
- name: "Checkout"
189150
uses: actions/checkout@v3
190151

191-
- name: "Cargo Build"
192-
uses: actions-rs/[email protected]
193-
with:
194-
command: build
195-
args: --no-default-features --features ${{ matrix.features }}
196-
197-
- name: "Cargo Test"
198-
uses: actions-rs/[email protected]
199-
with:
200-
command: test
201-
args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
152+
- name: "Run HTTP test"
153+
run: cargo +stable-gnu test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
202154

203155
os_compat_win-msvc_openssl:
204156
needs: test_suite
@@ -218,17 +170,8 @@ jobs:
218170
- name: "Checkout"
219171
uses: actions/checkout@v3
220172

221-
- name: "Cargo Build"
222-
uses: actions-rs/[email protected]
223-
with:
224-
command: build
225-
args: --no-default-features --features ${{ matrix.features }}
226-
227-
- name: "Cargo Test"
228-
uses: actions-rs/[email protected]
229-
with:
230-
command: test
231-
args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
173+
- name: "Run HTTP test"
174+
run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
232175

233176
# Commenting this out for now; getting GNU and OpenSSL set up properly on Windows will take some more work
234177
# os_compat_win_gnu_openssl:
@@ -243,26 +186,4 @@ jobs:
243186
# - "openssl-vendored,native-tls-vendored"
244187
# runs-on: windows-latest
245188
# steps:
246-
# - name: "Install OpenSSL"
247-
# run: vcpkg install openssl:x64-windows-static-md
248-
249-
# - name: "Set GNU Rust Toolchain"
250-
# uses: "actions-rs/toolchain@v1"
251-
# with:
252-
# toolchain: stable-x86_64-pc-windows-gnu
253-
# override: true
254-
255-
# - name: "Checkout"
256-
# uses: actions/checkout@v3
257-
258-
# - name: "Cargo Build"
259-
# uses: actions-rs/[email protected]
260-
# with:
261-
# command: build
262-
# args: --no-default-features --features ${{ matrix.features }}
263-
264-
# - name: "Cargo Test"
265-
# uses: actions-rs/[email protected]
266-
# with:
267-
# command: test
268-
# args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub
189+
# TODO

0 commit comments

Comments
 (0)