Skip to content

Commit

Permalink
Update CI script (#26)
Browse files Browse the repository at this point in the history
* Update grcov version, set CARGO_INCREMENTAL=0 for entire workflow
* Various small improvements
  • Loading branch information
FreezyLemon authored Feb 22, 2024
1 parent 24fce24 commit ecebaab
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
GRCOV_VERSION: v0.8.19

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
Expand All @@ -24,12 +26,11 @@ jobs:
runs-on: ubuntu-latest

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

- name: Install Rust nightly and miri
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: miri, rust-src

- name: Run miri
Expand All @@ -43,40 +44,31 @@ jobs:
runs-on: ubuntu-latest

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

- name: Install Rust stable
- name: Install Rust stable and LLVM tools
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: llvm-tools-preview

- name: Install grcov
env:
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_VERSION: v0.8.7
run: |
curl -L "$GRCOV_LINK/$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" |
tar xj -C $HOME/.cargo/bin
- name: Install llvm-tools-preview
run: |
rustup component add llvm-tools-preview
run: >
curl -L "https://github.com/mozilla/grcov/releases/download/$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2"
| tar xj -C "$HOME/.cargo/bin"
- name: Run cargo clean
run: |
cargo clean
run: cargo clean

- name: Run tests
env:
CARGO_INCREMENTAL: 0
LLVM_PROFILE_FILE: "{{ name }}-%p-%m.profraw"
RUSTFLAGS: >
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code
-Coverflow-checks=off
RUSTDOCFLAGS: >
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code
-Coverflow-checks=off
run: |
cargo test --verbose
run: cargo test
- name: Get coverage data for codecov
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \
Expand Down

0 comments on commit ecebaab

Please sign in to comment.