-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added three different pipeline files: Cargo clippy and fmt workflow Cargo check and test workflow And full on tests with coverage and upload to codecov.
- Loading branch information
Showing
3 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: rustfmt and clippy with annotations | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
fmt_lib: | ||
name: rustfmt on parsimony lib | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --manifest-path ./parsimony/Cargo.toml --all -- --check | ||
|
||
clippy_check_lib: | ||
name: clippy on parsimony lib | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: rustup component add clippy | ||
- uses: actions-rs/clippy-check@v1.0.7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --manifest-path ./parsimony/Cargo.toml --all-features -- -D warnings | ||
|
||
fmt_bin: | ||
name: rustfmt on indelMaP bin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --manifest-path ./indelMaP/Cargo.toml --all -- --check | ||
|
||
clippy_check_bin: | ||
name: clippy on indelMaP bin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: rustup component add clippy | ||
- uses: actions-rs/clippy-check@v1.0.7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --manifest-path ./indelMaP/Cargo.toml --all-features -- -D warnings |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: library tests with coverage | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
name: tests with coverage | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTFLAGS: -Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort | ||
RUSTDOCFLAGS: -Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
- name: Generate test results and coverage report | ||
run: | | ||
cargo install cargo2junit grcov; | ||
rustup component add llvm-tools-preview; | ||
cargo test --manifest-path ./parsimony/Cargo.toml -- -Z unstable-options --format json | cargo2junit > results.xml; | ||
grcov . -s . --binary-path ./parsimony/target/debug/deps -t lcov --branch --ignore "**/*tests.rs" -o lcov.info; | ||
- name: publish test results to github | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: results.xml | ||
- name: upload coverage report to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: lcov.info |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: tests on stable | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check_lib: | ||
name: cargo check lib | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --manifest-path ./parsimony/Cargo.toml | ||
|
||
test_lib: | ||
name: cargo test lib | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
- name: install cargo2junit | ||
run: | | ||
cargo install cargo2junit | ||
- name: tests with cargo2junit | ||
run: | | ||
cargo test --manifest-path ./parsimony/Cargo.toml -- -Z unstable-options --format json --report-time | cargo2junit > results.xml | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: results.xml | ||
|
||
check_bin: | ||
name: cargo check bin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --manifest-path ./indelMaP/Cargo.toml | ||
|
||
test_bin: | ||
name: cargo test bin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
- name: install cargo2junit | ||
run: | | ||
cargo install cargo2junit | ||
- name: tests with cargo2junit | ||
run: | | ||
cargo test --manifest-path ./indelMaP/Cargo.toml -- -Z unstable-options --format json --report-time | cargo2junit > results.xml | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: results.xml |