Skip to content

Commit

Permalink
coverage path is now OS-specific
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyTeichman committed Dec 5, 2023
1 parent 7f8a597 commit 196c44f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ jobs:
os: [ ubuntu-latest, windows-latest, macos-latest ]

steps:
- name: Set up coverage path
run: echo "COVERAGE_PATH=./coverage/" >> $GITHUB_ENV
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: Set up coverage path for Windows
run: |
echo "COVERAGE_PATH=D:/coverage/" >> $GITHUB_ENV
mkdir -p D:/coverage
if: runner.os == 'Windows
- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -40,16 +49,15 @@ jobs:
run: cargo test --verbose
- name: Collecting code coverage
run: |
mkdir -p ./coverage
cargo install grcov
grcov ${GITHUB_WORKSPACE}/coverage/ -b ./target/debug/deps/ -s . -t lcov --llvm --branch --ignore-not-existing --output-path ./coverage/lcov.info --token ${{ secrets.COVERALLS_REPO_TOKEN }}
grcov ${GITHUB_WORKSPACE}/coverage/ -b ./target/debug/deps/ -s . -t lcov --llvm --branch --ignore-not-existing --output-path ${{ env.COVERAGE_PATH }} --token ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Print lcov.info for debugging
run: head -n 100 ./coverage/lcov.info
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./coverage/lcov.info
file: ${{ env.COVERAGE_PATH }}
flag-name: run-${{ matrix.rust }}
parallel: true

Expand Down

0 comments on commit 196c44f

Please sign in to comment.