Merge pull request #18 from korpling/feature/fix-github-languages #85
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: Code Coverage | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
coverage: | |
name: Execute tests with code coverage | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/[email protected] | |
with: | |
toolchain: stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- uses: nanasess/setup-chromedriver@v2 | |
- name: Start chromedriver for tests | |
run: | | |
export DISPLAY=:99 | |
chromedriver --port=4444 & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
- name: Generate code coverage | |
run: cargo llvm-cov --all-features --ignore-filename-regex 'tests?\.rs' --codecov --output-path codecov.json | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: codecov.json | |
fail_ci_if_error: true |