Skip to content

Commit 3770fae

Browse files
jschweemilio
authored andcommitted
CI: Fix warnings in Github actions
Fixes the following warning: > Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions-rs/cargo@v1, actions-rs/toolchain@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Steps: - upgrade checkout to v3 - Replace the actions-rs/cargo action, by simply calling cargo from the commandline. I don't see why one would want to involve a node.js action there in the first place. - Replace the actions-rs/toolchain with dtolnays version, which uses the shell instead of node.js
1 parent 36ebe9a commit 3770fae

File tree

2 files changed

+23
-32
lines changed

2 files changed

+23
-32
lines changed

Diff for: .github/workflows/cbindgen.yml

+21-26
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,43 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818

1919
- name: Install stable
2020
uses: dtolnay/rust-toolchain@stable
2121
with:
2222
components: "clippy, rustfmt"
2323

2424
- name: Run rustfmt
25-
uses: actions-rs/cargo@v1
26-
with:
27-
command: fmt
28-
args: -- --check
25+
run: |
26+
cargo fmt --check
2927
3028
- name: Run clippy
3129
run: |
3230
cargo clippy --workspace -- -D warnings
3331
3432
- name: Install minimum supported Rust version
35-
uses: actions-rs/toolchain@v1
36-
with:
37-
profile: minimal
38-
toolchain: 1.54.0
33+
id: msrv
34+
uses: dtolnay/[email protected]
3935

4036
- name: Build with minimum supported Rust version
4137
run: |
42-
cargo +1.54.0 test nonexistent-test --verbose
38+
cargo +${{steps.msrv.outputs.name}} test nonexistent-test --verbose
4339
4440
build:
4541

4642
runs-on: ubuntu-latest
4743

4844
steps:
49-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
5046

51-
- name: Install Rust
52-
uses: actions-rs/toolchain@v1
53-
with:
54-
profile: minimal
55-
toolchain: nightly
56-
override: true
47+
- name: Install stable Rust
48+
uses: dtolnay/rust-toolchain@stable
5749

5850
- name: Install Python
59-
uses: actions/setup-python@v2
51+
uses: actions/setup-python@v4
6052
with:
61-
python-version: '3.8.*'
53+
python-version: '3.8'
6254

6355
- name: Install Cython
6456
run: |
@@ -73,20 +65,23 @@ jobs:
7365
run: |
7466
cargo build --verbose --no-default-features
7567
76-
- name: Test
68+
- name: Test package
7769
env:
7870
CBINDGEN_TEST_VERIFY: 1
7971
run: |
80-
cargo test --verbose
72+
cargo package --verbose
73+
(cd target/package/cbindgen-$(cargo run -- --version | cut -d ' ' -f 2) && cargo test --verbose)
8174
82-
- name: Test package
75+
- name: Install nightly Rust
76+
uses: dtolnay/rust-toolchain@nightly
77+
78+
- name: Test
8379
env:
8480
CBINDGEN_TEST_VERIFY: 1
8581
run: |
86-
cargo package --verbose
87-
(cd target/package/cbindgen-$(cargo run -- --version | cut -d ' ' -f 2) && cargo test --verbose)
82+
cargo +nightly test --verbose
8883
8984
- name: Test minimal-versions
9085
run: |
91-
cargo update -Zminimal-versions
92-
cargo test
86+
cargo +nightly update -Zminimal-versions
87+
cargo +nightly test

Diff for: .github/workflows/deploy.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616

1717
- name: Install stable
18-
uses: actions-rs/toolchain@v1
19-
with:
20-
profile: minimal
21-
toolchain: stable
22-
override: true
18+
uses: dtolnay/rust-toolchain@stable
2319

2420
- name: Build cbindgen
2521
run: |

0 commit comments

Comments
 (0)