cf2130090e
* fix(ci): build the workspace once per e2e job * perf(ci): cache rust compilations with sccache * fix(ci): stop sccache idling out mid-compile and cancel superseded runs * fix(tests): poll for the new root index instead of a fixed sleep * perf(ci): cache release target builds with sccache
200 lines
5.6 KiB
YAML
200 lines
5.6 KiB
YAML
name: Rust CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'doc/**'
|
|
pull_request:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'doc/**'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
# Ensure consistent macOS deployment target across all compiled objects
|
|
# (Rust, cc-compiled C code, and Zig-compiled zlob) to avoid linker warnings
|
|
MACOSX_DEPLOYMENT_TARGET: "13"
|
|
# RUSTC_WRAPPER is set per job, since cargo fmt runs without sccache.
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
# fff-search alone exceeds the 600s default on windows, and the server sees
|
|
# no new requests while it compiles, so it would idle out mid-unit.
|
|
SCCACHE_IDLE_TIMEOUT: "0"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
# Guard against deadlocks in the shared-picker / watcher teardown
|
|
# path: a stuck test would otherwise consume a full 6h CI slot.
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
# Zig is required to compile zlob
|
|
- name: Install Zig
|
|
uses: goto-bus-stop/setup-zig@v2
|
|
with:
|
|
version: 0.16.0
|
|
|
|
- name: Install Rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1.15.4
|
|
with:
|
|
cache: true
|
|
cache-on-failure: true
|
|
cache-key: "v1-rust"
|
|
components: rustfmt, clippy
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
with:
|
|
version: v0.17.0
|
|
|
|
- name: Run tests
|
|
env:
|
|
RUSTC_WRAPPER: sccache
|
|
# fff-python requires full python o3 machinery which is very slow
|
|
run: cargo test --no-default-features --features zlob --workspace --exclude fff-nvim --exclude fff-python
|
|
|
|
stress-test:
|
|
name: Fuzz Tests
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
# Keep going after one OS fails so we can see whether a bug
|
|
# reproduces everywhere or is platform-specific.
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
# Long-running; don't let a stuck watcher thread burn a full CI
|
|
# timeout. Two scenarios should finish well under this limit.
|
|
timeout-minutes: 20
|
|
env:
|
|
FFF_STRESS_CASES: "5"
|
|
FFF_STRESS_MIN_OPS: "30"
|
|
FFF_STRESS_MAX_OPS: "60"
|
|
RUSTC_WRAPPER: sccache
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install Zig
|
|
uses: goto-bus-stop/setup-zig@v2
|
|
with:
|
|
version: 0.16.0
|
|
|
|
- name: Install Rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1.15.4
|
|
with:
|
|
cache: true
|
|
cache-on-failure: true
|
|
cache-key: "v1-rust-stress-${{ matrix.os }}"
|
|
components: rustfmt, clippy
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
with:
|
|
version: v0.17.0
|
|
|
|
- name: Stress test seeded
|
|
shell: bash
|
|
run: make test-stress-seeded
|
|
|
|
- name: Stress test random
|
|
shell: bash
|
|
run: make test-stress-random
|
|
|
|
- name: Stress test regressions
|
|
shell: bash
|
|
run: make test-stress-regressions
|
|
|
|
- name: Upload proptest regressions on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: proptest-regressions-${{ matrix.os }}
|
|
path: crates/fff-core/tests/fuzz_git_watcher_stress.proptest-regressions
|
|
if-no-files-found: ignore
|
|
|
|
build-i686:
|
|
name: Build i686-unknown-linux-gnu
|
|
runs-on: ubuntu-latest
|
|
# Verifies that fff-search compiles on 32-bit x86, where std::arch::x86_64
|
|
# is unavailable. SIMD paths are disabled on this target; only the scalar
|
|
# fallback should build. See issue #656.
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install cross toolchain
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gcc-multilib g++-multilib
|
|
|
|
- name: Install Rust (i686 target)
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1.15.4
|
|
with:
|
|
target: i686-unknown-linux-gnu
|
|
cache: true
|
|
cache-on-failure: true
|
|
cache-key: "v1-rust-i686"
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
with:
|
|
version: v0.17.0
|
|
|
|
- name: Build fff-search for i686
|
|
env:
|
|
RUSTC_WRAPPER: sccache
|
|
run: cargo build -p fff-search --target i686-unknown-linux-gnu
|
|
|
|
fmt:
|
|
name: cargo fmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt
|
|
- name: Check formatting
|
|
run: cargo fmt -- --check
|
|
|
|
clippy:
|
|
name: cargo clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
# Zig is required to compile zlob
|
|
- name: Install Zig
|
|
uses: goto-bus-stop/setup-zig@v2
|
|
with:
|
|
version: 0.16.0
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
with:
|
|
version: v0.17.0
|
|
|
|
- name: Run clippy
|
|
env:
|
|
RUSTC_WRAPPER: sccache
|
|
run: cargo clippy --no-default-features --features zlob -- -D warnings
|