2024-01-06 11:14:30 +01:00
|
|
|
name: Cargo CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2024-01-06 19:49:41 +01:00
|
|
|
CARGO_TERM_VERBOSE: true
|
2024-01-06 11:14:30 +01:00
|
|
|
|
|
|
|
jobs:
|
2024-01-06 16:14:07 +01:00
|
|
|
build_and_test:
|
|
|
|
name: Build and Test
|
2024-05-03 12:07:41 +02:00
|
|
|
container: docker.io/drrobot/musichoard-ci:rust-1.78
|
2024-01-06 19:49:41 +01:00
|
|
|
env:
|
|
|
|
BEETSDIR: ./
|
|
|
|
LLVM_PROFILE_FILE: target/debug/profraw/musichoard-%p-%m.profraw
|
|
|
|
RUSTFLAGS: -C instrument-coverage
|
2024-01-06 11:14:30 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-02-10 20:58:40 +01:00
|
|
|
- run: cargo build --no-default-features --all-targets
|
|
|
|
- run: cargo test --no-default-features --all-targets --no-fail-fast
|
|
|
|
- run: cargo build --all-targets
|
|
|
|
- run: cargo test --all-targets --no-fail-fast
|
|
|
|
- run: cargo build --all-features --all-targets
|
|
|
|
- run: cargo test --all-features --all-targets --no-fail-fast
|
2024-01-06 19:49:41 +01:00
|
|
|
- run: >-
|
|
|
|
grcov target/debug/profraw
|
|
|
|
--binary-path target/debug/
|
|
|
|
--output-types html
|
|
|
|
--source-dir .
|
|
|
|
--ignore-not-existing
|
2024-02-18 22:12:41 +01:00
|
|
|
--ignore "build.rs"
|
2024-03-17 14:19:30 +01:00
|
|
|
--ignore "examples/*"
|
2024-01-06 19:49:41 +01:00
|
|
|
--ignore "tests/*"
|
|
|
|
--ignore "src/main.rs"
|
2024-01-11 21:29:03 +01:00
|
|
|
--ignore "src/bin/musichoard-edit.rs"
|
2024-01-06 19:49:41 +01:00
|
|
|
--excl-start "GRCOV_EXCL_START|mod tests \{"
|
|
|
|
--excl-stop "GRCOV_EXCL_STOP"
|
|
|
|
--output-path ./target/debug/coverage/
|
|
|
|
- run: >-
|
|
|
|
python3 .gitea/scripts/coverage.py
|
|
|
|
--coverage-file ./target/debug/coverage/coverage.json
|
|
|
|
--fail-under 100.00
|
2024-01-06 16:14:07 +01:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
container: docker.io/drrobot/musichoard-ci:rust-1.75
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-02-10 20:58:40 +01:00
|
|
|
- run: cargo clippy --no-default-features --all-targets -- -D warnings
|
|
|
|
- run: cargo clippy --all-targets -- -D warnings
|
|
|
|
- run: cargo clippy --all-features --all-targets -- -D warnings
|
2024-01-06 19:49:41 +01:00
|
|
|
- run: cargo fmt -- --check
|