Repository navigation
fix(samply): bump merged sampler and align unwinding arguments #2985
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| # Cancel in progress runs if a new one is queued everywhere but on pushes and workflow dispatch events | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }} | |
| env: | |
| # Fail instead of building valgrind from source on systems we publish no package for | |
| CODSPEED_VALGRIND_BUILD_FROM_SOURCE: "false" | |
| jobs: | |
| lint: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| with: | |
| components: rustfmt, clippy | |
| - uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0 | |
| 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-26.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| lfs: true | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| - uses: ./.github/actions/install-bpf-deps | |
| - run: cargo test --all --exclude memtrack --exclude exec-harness | |
| executor-tests: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x86_64, arm64] | |
| base-image: ["ubuntu:24.04", "ubuntu:26.04"] | |
| include: | |
| - arch: x86_64 | |
| runner: ubuntu-26.04 | |
| - arch: arm64 | |
| runner: ubuntu-26.04-arm | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - uses: taiki-e/install-action@68a389c788b2cd04016ce8c80ee23b80d2ab3d68 # v2 | |
| with: | |
| tool: just | |
| # No cache for now here, but we could cache either docker volumes or mounted host directories to cache build artifacts | |
| - run: just test-integ | |
| env: | |
| CODSPEED_TEST_BASE_IMAGE: ${{ matrix.base-image }} | |
| # Runs against an unreleased valgrind-codspeed branch, tag or full commit SHA | |
| # CODSPEED_VALGRIND_REF: my-valgrind-branch | |
| exec-harness-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| - name: Run tests | |
| run: cargo test -p exec-harness | |
| basic-run-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| extra-args: --skip-upload | |
| - os: ubuntu-26.04 | |
| extra-args: "" | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| with: | |
| cache-key: ${{ matrix.os }} | |
| - name: Run tests | |
| run: cargo run -- exec ${{ matrix.extra-args }} -m simulation,walltime,memory --warmup-time 0s --max-rounds 5 -- sleep 1 | |
| macos-basic-run-test: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| - name: Install exec-harness | |
| run: | | |
| cargo install --path crates/exec-harness --locked | |
| - name: Run tests | |
| env: | |
| # Profiling system commands (e.g. `ls`) with samply is not yet supported on MacOS | |
| CODSPEED_PROFILER_ENABLED: "false" | |
| run: cargo run -- exec -m walltime --skip-upload --warmup-time 0s --max-rounds 5 -- ls -la | |
| bpf-tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| [ | |
| ubuntu-22.04, | |
| ubuntu-24.04, | |
| ubuntu-24.04-arm, | |
| ubuntu-26.04, | |
| ubuntu-26.04-arm, | |
| ] | |
| # Each memtrack integration test binary runs its cases serially | |
| # (eBPF tracker can't overlap with itself in one process), so we | |
| # shard at the test-binary level to parallelize across jobs. | |
| test: | |
| [ | |
| c_tests, | |
| cpp_tests, | |
| rust_tests, | |
| spawn_tests, | |
| dlopen_tests, | |
| rss_tests, | |
| stack_tests, | |
| interpreter_tests, | |
| ] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| lfs: true | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| with: | |
| cache-key: ${{ matrix.os }}-${{ matrix.test }} | |
| - uses: ./.github/actions/install-bpf-deps | |
| - name: Install additional allocators | |
| run: sudo apt-get install -y libmimalloc-dev libjemalloc-dev | |
| # The perf trampoline needs Python 3.12+. | |
| - name: Install Python with perf trampoline support | |
| if: matrix.test == 'interpreter_tests' | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Run tests | |
| env: | |
| RUST_LOG: debug | |
| # Ubuntu 26.04 ships sudo-rs, which ignores `-E`; pass the env the | |
| # rustup shims and the test gate need through `env` instead. | |
| run: | | |
| sudo env \ | |
| "HOME=$HOME" \ | |
| "PATH=$PATH" \ | |
| "CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}" \ | |
| "RUSTUP_HOME=${RUSTUP_HOME:-$HOME/.rustup}" \ | |
| "CARGO_INCREMENTAL=$CARGO_INCREMENTAL" \ | |
| "RUST_LOG=$RUST_LOG" \ | |
| "GITHUB_ACTIONS=$GITHUB_ACTIONS" \ | |
| $(which cargo) test --lib --test ${{ matrix.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: ${{ matrix.mode == 'walltime' && 'codspeed-macro' || 'ubuntu-latest' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mode: [simulation, walltime, memory] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| - name: Install cargo codspeed | |
| uses: taiki-e/install-action@68a389c788b2cd04016ce8c80ee23b80d2ab3d68 # v2 | |
| with: | |
| tool: cargo-codspeed | |
| - name: Build benchmarks | |
| run: cargo codspeed build -p runner-shared -m ${{ matrix.mode }} | |
| - name: Run benchmarks | |
| uses: CodSpeedHQ/action@61efe07e57e55bedeab750c434504de272a56e8c # v5.6.1 | |
| with: | |
| mode: ${{ matrix.mode }} | |
| run: cargo codspeed run -p runner-shared | |
| memtrack-benchmarks: | |
| runs-on: codspeed-macro | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Both physical variants of a workload live in the same file, so they | |
| # are measured back to back. | |
| workload: [dd, tar] | |
| env: | |
| CODSPEED_REV: ${{ github.event.pull_request.head.sha || github.sha }} | |
| CARGO_TARGET_DIR: ${{ github.workspace }}/target | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/install-rust | |
| - uses: ./.github/actions/install-bpf-deps | |
| - name: Install memtrack and codspeed-runner | |
| run: | | |
| cargo install --locked --path crates/memtrack | |
| cargo install --locked --path . | |
| - name: Verify installed binaries | |
| run: | | |
| which codspeed codspeed-memtrack | |
| codspeed --version | |
| codspeed-memtrack --version | |
| # The benchmarked command is memtrack itself, which needs file capabilities | |
| # to load its eBPF programs even though the runner measures walltime. | |
| - name: Grant memtrack file capabilities | |
| run: codspeed setup --mode memory | |
| # The write benchmarks overwrite these files every round; creating them | |
| # inside a measured round would time one-off disk allocation. | |
| - name: Pre-create benchmark archives | |
| run: | | |
| mkdir -p /tmp/codspeed-memtrack-bench | |
| tar -cf /tmp/memtrack-bench.tar /usr/bin | |
| dd if=/dev/zero of=/tmp/memtrack-bench-dd.bin bs=1M count=64 2> /dev/null | |
| - name: Run memtrack walltime benchmarks (${{ matrix.workload }}) | |
| uses: CodSpeedHQ/action@61efe07e57e55bedeab750c434504de272a56e8c # v5.6.1 | |
| with: | |
| config: crates/memtrack/benchmarks/${{ matrix.workload }}.yml | |
| mode: walltime | |
| runner-version: rev:${{ env.CODSPEED_REV }} | |
| skip-hash-check-warning: true | |
| check: | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - lint | |
| - tests | |
| - executor-tests | |
| - exec-harness-tests | |
| - basic-run-test | |
| - macos-basic-run-test | |
| - bpf-tests | |
| - benchmarks | |
| - memtrack-benchmarks | |
| steps: | |
| - uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJson( needs ) }} |