name: Continuous integration
on:
pull_request:
push:
branches:
- main
jobs:
unitary_tests:
name: Run unitary tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- name: Cargo clippy
uses: actions-rs/clippy@master
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
coverage:
name: Update coverage report
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: llvm-tools-preview
- name: Cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Cargo llvm-cov
run: cargo llvm-cov --locked --lcov --output-path lcov.info --no-default-features --package geocart -- --nocapture
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true