diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000..81ea2203 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,20 @@ +# ref: https://docs.codecov.com/docs/codecovyml-reference +coverage: + range: 85..100 + round: down + precision: 1 + status: + # ref: https://docs.codecov.com/docs/commit-status + project: + default: + # Avoid false negatives + threshold: 1% + +# Test files aren't important for coverage +ignore: + - "tests" + +# Make comments less noisy +comment: + layout: "files" + require_changes: true \ No newline at end of file diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f1842f02..3c36e351 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,29 +10,36 @@ on: jobs: coverage: runs-on: ubuntu-latest - container: - image: xd009642/tarpaulin:develop-nightly - options: --security-opt seccomp=unconfined - steps: - - name: Checkout sources - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview - name: Install ubuntu dependencies run: | - apt-get update && apt-get install --no-install-recommends -y \ + sudo apt-get update && sudo apt-get install --no-install-recommends -y \ build-essential \ llvm-dev \ libcfitsio-dev \ pkg-config \ libssl-dev \ python3 - - - name: Run cargo-tarpaulin - run: | - cargo +nightly tarpaulin --manifest-path fitsio/Cargo.toml --verbose --timeout 120 --out lcov - - - name: Coveralls - uses: coverallsapp/github-action@master + - name: cargo install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + run: cargo generate-lockfile + - name: cargo llvm-cov + run: cargo llvm-cov -p fitsio --locked --lcov --output-path lcov.info + - name: Record Rust version + run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV" + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: lcov.info + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + env_vars: OS,RUST