Implement Config Files validations and Cargo Nextest for testing in CI pipeline #26
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: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
- cron: "0 5 * * 0" | |
env: | |
LOG_LEVEL: debug | |
CARGO_TERM_COLOR: always | |
MIN_LINE_COVERAGE_TARGET: 80 | |
jobs: | |
Config-files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Repository | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: false | |
- name: Setup Taplo | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: taplo-cli | |
- name: Install yamlfmt | |
run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest | |
- name: Verify Project | |
run: cargo verify-project --verbose | |
- name: Verify YAML Files Format | |
run: yamlfmt --lint . | |
- name: Verify TOML Files Format | |
run: taplo fmt --check --verbose --diff | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Repository | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt, clippy | |
- name: Format | |
run: cargo fmt --all --check | |
- name: Lints | |
run: cargo clippy --workspace --all-features | |
- name: Build | |
run: cargo build --workspace --all-features | |
Documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Repository | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Build Crate Doc | |
run: cargo doc --workspace --all-features --document-private-items --verbose | |
- name: Doc Tests | |
run: cargo test --workspace --all-features --doc | |
Tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Repository | |
uses: actions/checkout@v4 | |
- name: Setup cargo-llvm-cov | |
uses: taiki-e/[email protected] | |
with: | |
tool: cargo-llvm-cov | |
- name: Unit & Integration Tests | |
run: cargo llvm-cov --workspace --all-features --show-missing-lines --summary-only --fail-under-lines ${{ env.MIN_LINE_COVERAGE_TARGET }} | |
Security: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Repository | |
uses: actions/checkout@v4 | |
- name: Security Analysis | |
uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
log-level: ${{ env.LOG_LEVEL }} | |
command: check |