Files
Bear-mirror/.github/workflows/build_rust.yml
Laszlo Nagy ae2493d5ec test: replace BEAR_TEST_VERBOSE with RUST_LOG
Collapse the integration-test verbosity controls onto a single
inherited RUST_LOG. run_bear no longer forces RUST_LOG=debug; it
inherits the test-process value, defaulting to info when unset --
this keeps warn/info/error log lines in captured stderr (so tests
that assert on them still work) while filtering the per-event
debug traces from the preload library that ccache was caching and
replaying through Command::status() leaks. CI sets RUST_LOG=debug
explicitly for full per-event traces on platforms that can't be
reproduced locally.

Drop::preserve_on_panic now dumps the last captured BearOutput
unconditionally; cargo's per-test capture handles the show-on-
failure filter for both Err returns and panics. The verbose-gated
inline debug-info blocks in CompilationDatabase / InterceptEvents
assertion methods, the new_with_verbose constructor, the
verbose: macro arm of bear_test!, and all the
show_verbose_if_enabled / force_show_verbose / show_last_bear_output
helpers are gone. BEAR_TEST_PRESERVE_FAILURES stays unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 11:26:53 +00:00

111 lines
2.8 KiB
YAML

name: rust CI
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy,rustfmt
- run: cargo clippy --all-targets -- -D warnings
- run: cargo fmt -- --check
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: cargo build --verbose --release
test:
name: Test
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
toolchain:
- stable
- nightly
runs-on: ${{ matrix.os }}
needs: [compile]
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
- name: Install ccache on Ubuntu
# Bear's wrapper-recursion integration test
# (wrapper_mode_survives_masquerade_wrapper_in_path) needs a ccache
# masquerade dir to exist. The ccache package creates
# /usr/lib/ccache/* symlinks; the test injects that dir into its own
# child PATH. We deliberately do NOT prepend the dir to the job
# PATH, because ccache first on PATH would inflate event counts
# for other tests that assert exact compiler-event counts.
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ccache
- name: Run integration tests
run: |
cargo build --verbose
cargo test --verbose
env:
RUST_LOG: debug
doc:
name: Generate Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: cargo doc --no-deps
spellcheck:
name: Spell Check Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Codespell
run: pip install codespell
- name: Run Codespell
run: codespell
copyright:
name: Generate Copyright Notes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Cargo License
run: cargo install cargo-license
- name: Generate License Report
run: cargo license
security-audit:
name: Security Audit
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v6
- name: Install Cargo Audit
run: cargo install cargo-audit
- name: Run Cargo Audit
run: cargo audit