refactor: tighten application boundaries and task typing #875
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-Dwarnings" | |
| jobs: | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo clippy --all-targets | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo test | |
| coverage: | |
| name: Coverage | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo install cargo-llvm-cov | |
| - name: Generate coverage | |
| run: | | |
| cargo llvm-cov --no-cfg-coverage 2>&1 | tee coverage-output.txt | |
| # Extract the summary table (last lines starting from the header) | |
| # Build summary: header + separator, file rows sorted by Lines Cover % desc, separator + TOTAL | |
| { | |
| grep -E '(^Filename|^---)' coverage-output.txt | head -2 | |
| grep '\.rs' coverage-output.txt | grep -v 'Running' | awk '{v=$0; gsub(/%/,""); print $10, v}' | sort -rn | cut -d' ' -f2- | |
| grep -E '(^----|^TOTAL)' coverage-output.txt | tail -2 | |
| } > coverage-sorted.txt | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cat coverage-sorted.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo build |