Xx/push npwmvxmwtqnt #114
Workflow file for this run
This file contains hidden or 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: | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- '**.md' | |
- '**.in' | |
- '**.cls' | |
- '**.sh' | |
- 'docs/**' | |
- 'LICENSE' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pr_naming: | |
name: conventional commits | |
runs-on: ubuntu-latest | |
steps: | |
- name: Lint Commit Messages | |
uses: wagoid/commitlint-github-action@v6 | |
code_quality: | |
name: Code Quality (format + clippy) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache Rust Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: Run fmt & clippy | |
run: | | |
cargo fmt -- --check | |
cargo clippy --all-targets --all-features -- -D warnings | |
tests: | |
name: Unit Tests (with coverage) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Cache Rust Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: Install cargo-tarpaulin | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-tarpaulin | |
- name: Run Tests with Coverage | |
run: | | |
cargo tarpaulin --out Xml --output-dir coverage.xml | |
- name: Upload Coverage Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage.xml | |
battle_test: | |
name: Battle Tests | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Cache Rust Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y parallel | |
- name: Run Battle Tests | |
run: | | |
chmod +x tests/battle_test/battle_testing.sh | |
GIT_TRACE=1 ./tests/battle_test/battle_testing.sh | |
- name: Upload Battle Test Logs | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: format-error-logs | |
path: tests/battle_test/format_errors.log | |
audit: | |
name: Security Audit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Cache Rust Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-audit | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-audit | |
- name: Install cargo-deny | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-deny | |
- name: Audit & Deny Checks | |
run: | | |
cargo audit --stale | |
cargo deny check | |