build: Add nix flake #171
Workflow file for this run
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.67.0 | |
with: | |
toolchain: ${{matrix.rust}} | |
components: rust-src, rustfmt | |
- uses: extractions/setup-just@v1 | |
- 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: | | |
just build | |
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.67.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/rbperf.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.67.0 | |
with: | |
components: rust-src, clippy, rustfmt | |
- uses: extractions/setup-just@v1 | |
- 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: | | |
just clippy | |
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.67.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 rbperf::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 -- rbperf::tests::rbperf_test_3_1_2 --nocapture |