fixup! added compile flags to build step #12
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
name: Rust | |
on: | |
push: | |
branches: [ "main", "development" ] | |
pull_request: | |
branches: [ "main", "development" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
steps: | |
- name: Install Rust nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up environment for code coverage | |
run: | | |
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV | |
echo "RUSTFLAGS=-C instrument-coverage" >> $GITHUB_ENV | |
echo "LLVM_PROFILE_FILE=${{ github.workspace }}/coverage/%p-%m.profraw" >> $GITHUB_ENV | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Collecting code coverage | |
run: | | |
cargo install grcov | |
grcov ${GITHUB_WORKSPACE}/coverage/ -b ./target/debug/deps/ -s . -t coveralls --llvm --branch --ignore-not-existing --output-path ./coverage.json --token ${{ secrets.COVERALLS_REPO_TOKEN }} | |
- name: Upload coverage to Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./coverage.json | |
flag-name: run-${{ matrix.rust }} | |
parallel: true |