Skip to content

Commit

Permalink
CI: Stop using actions-rs
Browse files Browse the repository at this point in the history
It seems the `actions-rs` collection of github actions are
unmaintained; using the `actions-rs/toolchain@v1` action causes
deprecation warnings in Github CI; see
<actions-rs/toolchain#221>.

So:

- Replace the `toolchain` action with `dtolnay/rust-toolchain`.
- Just run cargo directly instead of using the `cargo` action.
- Get rid of the code coverage check, which was broken anyway.
  • Loading branch information
Andreas Rottmann authored and rotty committed Mar 8, 2023
1 parent 3d0442d commit 8181451
Showing 1 changed file with 9 additions and 70 deletions.
79 changes: 9 additions & 70 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@ jobs:
uses: actions/checkout@v3

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

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
run: cargo check --all-features --all-targets

test:
name: Test Suite
Expand All @@ -29,16 +23,10 @@ jobs:
uses: actions/checkout@v3

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

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test --all-features --all-targets

msrv-check:
# We require at least Rust 1.45, so we can use proc macros in
Expand All @@ -51,11 +39,8 @@ jobs:
uses: actions/checkout@v3

- name: Install 1.45 toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.45.0
override: true
uses: dtolnay/[email protected]

# We use the git CLI here, since otherwise cargo fails with
# "error reading from the zlib stream; class=Zlib (5)", see
# <https://github.com/rust-lang/cargo/issues/10303>.
Expand All @@ -71,56 +56,10 @@ jobs:
uses: actions/checkout@v3

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

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings


codecov:
name: Code coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

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

- name: Build with instrumentation
uses: actions-rs/cargo@v1
with:
command: test
args: --package lexpr --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Cpanic=abort'

# TODO: collect statistics with `gcovr`, which doesn't play with
# current "gcov" binary format.
- name: Collect coverage information
uses: actions-rs/[email protected]

# TODO: upload coverage, see
# <https://github.com/marketplace/actions/codecov>
- name: Upload to codecov
uses: codecov/codecov-action@v1
run: cargo clippy -- -D warnings

0 comments on commit 8181451

Please sign in to comment.