build-aya.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. name: build-aya
  2. on:
  3. push:
  4. branches:
  5. - main
  6. - ci
  7. pull_request:
  8. branches:
  9. - main
  10. env:
  11. CARGO_TERM_COLOR: always
  12. jobs:
  13. build:
  14. strategy:
  15. matrix:
  16. arch:
  17. - x86_64-unknown-linux-gnu
  18. - aarch64-unknown-linux-gnu
  19. - armv7-unknown-linux-gnueabi
  20. - riscv64gc-unknown-linux-gnu
  21. runs-on: ubuntu-20.04
  22. steps:
  23. - uses: actions/checkout@v2
  24. - uses: actions-rs/toolchain@v1
  25. with:
  26. toolchain: stable
  27. override: true
  28. - uses: Swatinem/rust-cache@v1
  29. - name: Prereqs
  30. run: cargo install cross --git https://github.com/cross-rs/cross
  31. - name: Build
  32. run: cross build --verbose --target ${{matrix.arch}}
  33. - name: Run test
  34. env:
  35. RUST_BACKTRACE: full
  36. run: |
  37. cross test --verbose --target ${{matrix.arch}}
  38. test:
  39. runs-on: ubuntu-20.04
  40. needs: build
  41. steps:
  42. - uses: actions/checkout@v2
  43. - uses: actions/checkout@v2
  44. with:
  45. repository: libbpf/libbpf
  46. path: libbpf
  47. - uses: actions-rs/toolchain@v1
  48. with:
  49. toolchain: nightly
  50. components: rustfmt, clippy, rust-src
  51. target: x86_64-unknown-linux-musl
  52. override: true
  53. - uses: Swatinem/rust-cache@v1
  54. - name: Install Pre-requisites
  55. run: |
  56. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
  57. echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" | sudo tee -a /etc/apt/sources.list
  58. sudo apt-get update
  59. sudo apt-get -qy install linux-tools-common qemu-system-x86 cloud-image-utils openssh-client libelf-dev gcc-multilib llvm-15 clang-15
  60. sudo update-alternatives --install /usr/bin/llvm-objcopy llvm-objcopy /usr/bin/llvm-objcopy-15 200
  61. sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 200
  62. cargo install bpf-linker
  63. - name: Lint integration tests
  64. run: |
  65. cargo xtask build-integration-test-ebpf --libbpf-dir ./libbpf
  66. cargo clippy -p integration-test -- --deny warnings
  67. - name: Run integration tests
  68. run: |
  69. (cd test && ./run.sh ../libbpf)