Skip to content

Fix clippy errors on macos and run macos lint in CI #1819

Fix clippy errors on macos and run macos lint in CI

Fix clippy errors on macos and run macos lint in CI #1819

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
components: rustfmt, clippy
- uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2
with:
extra-args: --all-files
- name: Check config schema is up to date
if: matrix.os == 'ubuntu-latest'
run: cargo run --bin generate_config_schema && git diff --exit-code schemas/codspeed.schema.json
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
lfs: true
submodules: true
- uses: ./.github/actions/install-rust
# Install memtrack for the memory integration tests
- name: Install dependencies required for libbpf-sys (vendored feature)
run: sudo apt-get update && sudo apt-get install -y autopoint bison flex
- name: Install memtrack
run: |
cargo install --path crates/memtrack --locked
- name: Install exec-harness
run: |
cargo install --path crates/exec-harness --locked
- run: cargo test --all --exclude memtrack --exclude exec-harness
exec-harness-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: ./.github/actions/install-rust
- name: Run tests
run: cargo test -p exec-harness
basic-run-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: ./.github/actions/install-rust
- name: Run tests
run: cargo run -- exec -m simulation,walltime,memory --skip-upload --warmup-time 0s --max-rounds 5 -- ls -la
macos-basic-run-test:
runs-on: macos-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: ./.github/actions/install-rust
- name: Install exec-harness
run: |
cargo install --path crates/exec-harness --locked
- name: Run tests
run: cargo run -- exec -m walltime --skip-upload --warmup-time 0s --max-rounds 5 -- ls -la
bpf-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
lfs: true
submodules: true
- uses: ./.github/actions/install-rust
- name: Install dependencies required for libbpf-sys (vendored feature)
run: sudo apt-get update && sudo apt-get install -y autopoint bison flex
- name: Install additional allocators
run: sudo apt-get install -y libmimalloc-dev libjemalloc-dev
- name: Run tests
env:
RUST_LOG: debug
run: sudo -E $(which cargo) test -- --test-threads 1 --nocapture
working-directory: crates/memtrack
# Since we ran the tests with sudo, the build artifacts will have root ownership
- name: Clean up
run: sudo chown -R $USER:$USER . ~/.cargo
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: ./.github/actions/install-rust
- name: Install cargo codspeed
uses: taiki-e/install-action@0c7a94999971db56e9df89df226240aab222e776 # v2
with:
tool: cargo-codspeed
- name: Build benchmarks
run: cargo codspeed build -p runner-shared
- name: Run benchmarks
uses: CodSpeedHQ/action@db35df748deb45fdef0960669f57d627c1956c30 # v4
with:
mode: simulation
run: cargo codspeed run -p runner-shared