Skip to content

Reuse one LLM HTTP client across a whole monitor run #32

Reuse one LLM HTTP client across a whole monitor run

Reuse one LLM HTTP client across a whole monitor run #32

Workflow file for this run

name: ci
on:
push:
branches: [master]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets --locked -- -D warnings
- run: cargo test --locked
# The declared `rust-version` in Cargo.toml is a promise; this proves it.
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88.0
- uses: Swatinem/rust-cache@v2
- run: cargo check --all-targets
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-llvm-cov
# Unit-test coverage of the library and CLI. Browser-driven
# integration tests are exercised by the `test` job but excluded
# here to keep this job fast and deterministic.
- run: cargo llvm-cov --lib --bins --lcov --output-path lcov.info
- uses: actions/upload-artifact@v4
with:
name: coverage-lcov
path: lcov.info
if-no-files-found: error
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
# Build-only on macOS/Windows: catches platform-specific compile breaks
# (chromiumoxide/tokio have per-OS cfg'd bits) without spending CI time
# on a headless-Chrome download in every job — the unit tests are pure
# logic and only need to run once, on Linux.
build:
strategy:
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --locked
# Static analysis. Runs on pushes to the default branch only (not PRs)
# because uploading results requires the security-events permission,
# which isn't available to fork PRs.
codeql:
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
with:
languages: rust
- uses: github/codeql-action/autobuild@v3
- uses: github/codeql-action/analyze@v3