More unit tests #151
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: L2Shablya | |
on: | |
push: | |
branches: [ "master" ] | |
paths-ignore: | |
- "README.MD" | |
- "LiCENSE.MD" | |
- "*.svg" | |
- ".env" | |
pull_request: | |
branches: [ "master" ] | |
paths-ignore: | |
- "README.MD" | |
- "LiCENSE.MD" | |
- "*.svg" | |
- ".env" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-and-test: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Install Tarpaulin | |
run: | | |
if ! cargo tarpaulin --version &>/dev/null; then | |
cargo install cargo-tarpaulin | |
fi | |
- name: Run tests for proc macro (it's ignored by tarpauiln) | |
run: cargo test -p macro-common --verbose | |
- name: Generate LCOV coverage report | |
run: cargo tarpaulin --workspace --exclude test-utils --exclude macro-common --exclude migration --out Lcov --verbose | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: cobertura.xml | |
fail_ci_if_error: true | |
verbose: true | |
test-only: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Run tests | |
run: cargo test --verbose |