Updates codecov.io GH action (#853) #2915
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, pull_request ] | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ${{ matrix.os }} | |
# We want to run on external PRs, but not on internal ones as push automatically builds | |
# H/T: https://github.com/Dart-Code/Dart-Code/commit/612732d5879730608baa9622bf7f5e5b7b51ae65 | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'amazon-ion/ion-rust' | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
# We need this component to generate source coverage in stable | |
components: llvm-tools-preview | |
- name: Install `cargo-llvm-cov` | |
run: cargo install cargo-llvm-cov | |
- name: Cargo test w/code coverage | |
run: cargo llvm-cov --verbose --workspace --all-features --no-fail-fast --codecov --output-path codecov.json | |
- name: Codecov upload | |
uses: codecov/codecov-action@v4 | |
with: | |
files: codecov.json | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |