-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,39 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
run_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
- name: Run all tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --release | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
- name: Build | ||
run: cargo build --release --verbose | ||
- name: Run tests | ||
run: cargo test --release --verbose | ||
env: | ||
CARGO_INCREMENTAL: '0' | ||
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
- name: rust-grcov | ||
# You may pin to the exact commit or the version. | ||
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248 | ||
uses: actions-rs/grcov@v0.1 | ||
- name: Codecov | ||
# You may pin to the exact commit or the version. | ||
# uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 | ||
uses: codecov/codecov-action@v4-beta | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
# Repository upload token - get it from codecov.io. Required only for private repositories | ||
# token: # optional | ||
# Specify whether the Codecov output should be verbose | ||
verbose: true | ||
fail_ci_if_error: true | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
target: x86_64-unknown-linux-musl | ||
components: llvm-tools-preview | ||
- name: Download grcov | ||
run: | | ||
mkdir -p "${HOME}/.local/bin" | ||
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin" | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Run xtask coverage | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: xtask | ||
args: coverage | ||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v3 |