Specified more values in toolchain file #23
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
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
name: π Code Coverage | |
jobs: | |
grcov: | |
name: π grcov Code Coverage | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
&& !startsWith(github.event.head_commit.message, 'docs:') | |
&& !startsWith(github.event.head_commit.message, 'docs(') | |
&& !startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-apple-darwin | |
# - aarch64-unknown-linux-gnu | |
# - aarch64-apple-darwin | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
# - target: aarch64-unknown-linux-gnu | |
# os: ubuntu-latest | |
# - target: aarch64-apple-darwin | |
# os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π Checkout Git Repository | |
id: checkout_repository_step | |
uses: actions/checkout@v2 | |
- name: π§° Install Rust Toolchain | |
id: install_toolchain_step | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly # Required for -Zprofile | |
override: true | |
target: ${{ matrix.target }} | |
- name: π Set up cargo cache | |
id: setup_cache_step | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: π§ͺ Execute tests | |
id: execute_tests_step | |
uses: actions-rs/cargo@v1 | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | |
with: | |
command: test | |
args: --workspace --target ${{ matrix.target }} | |
- name: π½ Pre-Installing grcov | |
id: preinstall_grcov_step | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: grcov | |
use-tool-cache: true | |
- name: π Gather Coverage Data | |
id: coverage_gather_step | |
uses: actions-rs/grcov@v0.1 | |
with: | |
config: .github/actions-rs/grcov.yml | |
coveralls-token: ${{ secrets.COVERALLS_TOKEN }} | |
- name: β¬ Coveralls Upload | |
id: coveralls_upload_step | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel: true | |
path-to-lcov: ${{ steps.coverage_gather_step.outputs.report }} | |
grcov_finalize: | |
name: β Finalize grcov Code Coverage | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
&& !startsWith(github.event.head_commit.message, 'docs:') | |
&& !startsWith(github.event.head_commit.message, 'docs(') | |
&& !startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
runs-on: ubuntu-latest | |
needs: grcov | |
steps: | |
- name: β Coveralls Finalization | |
id: coveralls_finalization_step | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |