Add Basic CI (#13) #1
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
on: [push] | |
name: Build, Lint and Test | |
jobs: | |
check: | |
name: Rust project | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: 1.74 | |
components: rustfmt, clippy | |
- name: cargo fmt | |
run: cargo fmt --all -- --check | |
- name: cargo clippy | |
run: cargo clippy --workspace --all-targets # -- -Dwarnings | |
- name: cargo test | |
run: cargo test --workspace | |
- name: cargo doc | |
run: cargo doc --workspace | |
coverage: | |
name: Test Coverage | |
needs: check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: 1.74 | |
components: llvm-tools-preview, rustfmt | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --workspace --lcov --output-path lcov.info | |
- name: Upload Results to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: lcov.info | |
flags: unittests | |
name: pest3-ci-coverage | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |