Add initial iteration #1
This file contains 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: | |
branches: [main] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: [stable] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@1.71.0 | |
with: | |
toolchain: ${{matrix.rust}} | |
components: rust-src, rustfmt | |
- name: Install build system dependencies | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get -y install --no-install-recommends \ | |
curl \ | |
ca-certificates \ | |
clang \ | |
make \ | |
pkg-config \ | |
libelf-dev \ | |
zlib1g-dev | |
- name: Build | |
run: | | |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu' | |
cargo build | |
- name: Static build | |
run: | | |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu -C target-feature=+crt-static' | |
cargo build --target x86_64-unknown-linux-gnu | |
lint: | |
name: Lint | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: [stable] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@1.71.0 | |
with: | |
toolchain: ${{matrix.rust}} | |
components: rust-src, rustfmt | |
- name: Run cargo fmt | |
run: | | |
# These files are generated at build time, so some rustfmt versions | |
# fail with Error writing files: failed to resolve mod `bpf` if it | |
# does not exist | |
touch src/bpf/py-perf.rs | |
touch src/bpf/features.rs | |
cargo fmt | |
git diff --exit-code | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@1.71.0 | |
with: | |
components: rust-src, clippy, rustfmt | |
- name: Install build system dependencies | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get -y install --no-install-recommends \ | |
curl \ | |
ca-certificates \ | |
clang \ | |
make \ | |
pkg-config \ | |
libelf-dev \ | |
zlib1g-dev | |
- name: Run clippy | |
run: | | |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu' | |
cargo clippy -- -Dclippy::all | |
test: | |
name: Test | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: [stable] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@1.71.0 | |
with: | |
toolchain: ${{matrix.rust}} | |
components: rust-src, rustfmt | |
- name: Install build system dependencies | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get -y install --no-install-recommends \ | |
curl \ | |
ca-certificates \ | |
clang \ | |
make \ | |
pkg-config \ | |
libelf-dev \ | |
zlib1g-dev | |
- name: Run unittests | |
run: | | |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu' | |
export RUST_BACKTRACE=1 | |
cargo test -- --skip py-perf::tests | |
- name: Install podman | |
run: sudo apt-get -y install --no-install-recommends podman | |
- name: Pull Ruby containers | |
run: tools/pull_ruby_images | |
- name: Run integration tests | |
run: | | |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu' | |
export RUST_BACKTRACE=1 | |
# Running only 3.1.2 for a bit, will enable the rest once we make sure | |
# that things are looking good | |
cargo test -- py-perf::tests::py-perf_test_3_1_2 --nocapture |