Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Adds code coverage

Adds code coverage #6

Workflow file for this run

name: Coverage2
on: [pull_request, push]
jobs:
coverage2:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v2
# Start Docker Compose
- name: Start Docker Compose
run: docker-compose up -d
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
# Cache dependencies and build artifacts
- name: Cache build artifacts and dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
with:
command: build
env:
SQLX_OFFLINE: true
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --no-clean --all-features --frozen --lcov --output-path lcov.info
env:
SQLX_OFFLINE: true # needed to keep it from trying to connect to a database
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: true