|
|
|
name: build-aya
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- ci
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch:
|
|
|
|
- x86_64-unknown-linux-gnu
|
|
|
|
- aarch64-unknown-linux-gnu
|
|
|
|
- armv7-unknown-linux-gnueabi
|
|
|
|
- riscv64gc-unknown-linux-gnu
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
override: false
|
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Prereqs
|
|
|
|
run: cargo install cross --git https://github.com/cross-rs/cross
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cross build --verbose --target ${{matrix.arch}}
|
|
|
|
|
|
|
|
- name: Run test
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
|
|
|
run: |
|
|
|
|
cross test --verbose -p aya --target ${{matrix.arch}}
|
|
|
|
cross test --verbose -p aya-gen --target ${{matrix.arch}}
|
|
|
|
cross test --verbose -p aya-log --target ${{matrix.arch}}
|
|
|
|
cross test --verbose -p aya-log-ebpf-macros --target ${{matrix.arch}}
|
|
|
|
# aya-bpf-macros can only be tested on nightly since its tests depend on aya-bpf, which requires the never type
|
|
|
|
cross +nightly test --verbose -p aya-bpf-macros --target ${{matrix.arch}}
|
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs: build
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: libbpf/libbpf
|
|
|
|
path: libbpf
|
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt, clippy, rust-src
|
|
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
|
|
|
- name: Install Pre-requisites
|
|
|
|
run: |
|
|
|
|
sudo apt-get -qy install linux-tools-common qemu-system-x86 cloud-image-utils openssh-client libelf-dev gcc-multilib
|
|
|
|
cargo install bpf-linker
|
|
|
|
|
|
|
|
- name: Lint integration tests
|
|
|
|
run: |
|
|
|
|
cargo xtask build-integration-test-ebpf --libbpf-dir ./libbpf
|
|
|
|
cargo clippy -p integration-test -- --deny warnings
|
|
|
|
|
|
|
|
- name: Run integration tests
|
|
|
|
run: |
|
|
|
|
(cd test && ./run.sh ../libbpf)
|