Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Install Rust
description: Install the Rust toolchain via rustup and set up Swatinem/rust-cache.
inputs:
components:
description: Comma-separated list of additional rustup components to install (e.g. "rustfmt, clippy").
required: false
default: ""
runs:
using: composite
steps:
- name: Install rust-toolchain.toml
shell: bash
run: rustup toolchain install
- name: Install additional rustup components
if: inputs.components != ''
shell: bash
run: echo "${{ inputs.components }}" | tr ',' '\n' | xargs rustup component add
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
36 changes: 15 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@

jobs:
lint:
runs-on: ubuntu-latest
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: moonrepo/setup-rust@abb2d32350334249b178c401e5ec5836e0cd88d3 # v1
- uses: ./.github/actions/install-rust
with:
components: rustfmt, clippy
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
- uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2
with:
extra_args: --all-files
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:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -29,10 +34,7 @@
lfs: true
submodules: true

- name: "Install rust-toolchain.toml"
run: rustup toolchain install
# We use Swatinem/rust-cache to cache cargo registry, index and target in this job
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- uses: ./.github/actions/install-rust

# Install memtrack for the memory integration tests
- name: Install dependencies required for libbpf-sys (vendored feature)
Expand All @@ -52,7 +54,7 @@
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: moonrepo/setup-rust@abb2d32350334249b178c401e5ec5836e0cd88d3 # v1
- uses: ./.github/actions/install-rust
- name: Run tests
run: cargo test -p exec-harness

Expand All @@ -62,10 +64,7 @@
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: "Install rust-toolchain.toml"
run: rustup toolchain install
# We use Swatinem/rust-cache to cache cargo registry, index and target in this job
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- 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

Expand All @@ -75,10 +74,7 @@
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: "Install rust-toolchain.toml"
run: rustup toolchain install
# We use Swatinem/rust-cache to cache cargo registry, index and target in this job
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- uses: ./.github/actions/install-rust
- name: Install exec-harness
run: |
cargo install --path crates/exec-harness --locked
Expand All @@ -93,7 +89,7 @@
with:
lfs: true
submodules: true
- uses: moonrepo/setup-rust@abb2d32350334249b178c401e5ec5836e0cd88d3 # v1
- 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

Expand All @@ -117,9 +113,7 @@
with:
submodules: true

- name: "Install rust-toolchain.toml"
run: rustup toolchain install
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- uses: ./.github/actions/install-rust
- name: Install cargo codspeed
uses: taiki-e/install-action@0c7a94999971db56e9df89df226240aab222e776 # v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: clippy
args: [--all-targets, --, -D, warnings]
- repo: https://github.com/cpp-linter/cpp-linter-hooks
rev: v0.8.1
rev: v1.4.0
hooks:
- id: clang-format
files: ^crates/memtrack/src/ebpf/c/.*\.(c|h|bpf\.c)$
Expand Down
Loading
Loading