CI #35
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: | |
Project-Config: | |
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 Config | |
run: cargo verify-project --verbose | |
- name: Verify YAML Files Format | |
run: yamlfmt --lint . | |
- name: Verify TOML Files Format | |
run: taplo fmt --check --verbose --diff | |
Docs: | |
runs-on: ubuntu-latest | |
needs: Project-Config | |
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 | |
Build: | |
runs-on: ubuntu-latest | |
needs: Project-Config | |
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 | |
Tests: | |
runs-on: ubuntu-latest | |
needs: Build | |
steps: | |
- name: Fetch Repository | |
uses: actions/checkout@v4 | |
- name: Setup cargo-llvm-cov | |
uses: taiki-e/[email protected] | |
with: | |
tool: cargo-llvm-cov,cargo-nextest | |
- name: Unit & Integration Tests | |
run: cargo llvm-cov nextest --workspace --all-features --show-missing-lines --summary-only --fail-under-lines ${{ env.MIN_LINE_COVERAGE_TARGET }} | |
Security: | |
runs-on: ubuntu-latest | |
needs: Build | |
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 |