feat: policy simulation (what-if) mode #89
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: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Lint with Clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| cargo test 2>&1 | tee test-output.log | |
| test_status=${PIPESTATUS[0]} | |
| # Emit inline annotations for panic locations so PR diffs highlight failures. | |
| while IFS= read -r line; do | |
| if [[ "$line" == *"panicked at"* ]] && [[ "$line" =~ ([A-Za-z0-9_./-]+\.rs):([0-9]+):([0-9]+) ]]; then | |
| file="${BASH_REMATCH[1]}" | |
| line_no="${BASH_REMATCH[2]}" | |
| col_no="${BASH_REMATCH[3]}" | |
| msg="${line//'%'/'%25'}" | |
| msg="${msg//$'\n'/'%0A'}" | |
| msg="${msg//$'\r'/'%0D'}" | |
| echo "::error file=${file},line=${line_no},col=${col_no}::${msg}" | |
| fi | |
| done < test-output.log | |
| exit "$test_status" |