Skip to content

Commit

Permalink
CI: Fix warnings in Github actions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jschwe committed Mar 8, 2023
1 parent 36ebe9a commit 96a8118
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 32 deletions.
47 changes: 21 additions & 26 deletions .github/workflows/cbindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,43 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: "clippy, rustfmt"

- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: |
cargo fmt --check
- name: Run clippy
run: |
cargo clippy --workspace -- -D warnings
- name: Install minimum supported Rust version
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.54.0
id: msrv
uses: dtolnay/rust-toolchain@1.54

- name: Build with minimum supported Rust version
run: |
cargo +1.54.0 test nonexistent-test --verbose
cargo +${{steps.msrv.outputs.name}} test nonexistent-test --verbose
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable

- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8.*'
python-version: '3.8'

- name: Install Cython
run: |
Expand All @@ -73,20 +65,23 @@ jobs:
run: |
cargo build --verbose --no-default-features
- name: Test
- name: Test package
env:
CBINDGEN_TEST_VERIFY: 1
run: |
cargo test --verbose
cargo package --verbose
(cd target/package/cbindgen-$(cargo run -- --version | cut -d ' ' -f 2) && cargo test --verbose)
- name: Test package
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@nightly

- name: Test
env:
CBINDGEN_TEST_VERIFY: 1
run: |
cargo package --verbose
(cd target/package/cbindgen-$(cargo run -- --version | cut -d ' ' -f 2) && cargo test --verbose)
cargo +nightly test --verbose
- name: Test minimal-versions
run: |
cargo update -Zminimal-versions
cargo test
cargo +nightly update -Zminimal-versions
cargo +nightly test
8 changes: 2 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable

- name: Build cbindgen
run: |
Expand Down

0 comments on commit 96a8118

Please sign in to comment.