build-aya.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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-none-elf
  21. runs-on: ubuntu-20.04
  22. steps:
  23. - uses: actions/checkout@v2
  24. - uses: Swatinem/rust-cache@v1
  25. - name: Prereqs
  26. run: cargo install cross --git https://github.com/cross-rs/cross
  27. - name: Build
  28. run: cross build --verbose
  29. - name: Run test
  30. run: RUST_BACKTRACE=full cross test --verbose
  31. test:
  32. runs-on: ubuntu-20.04
  33. needs: build
  34. steps:
  35. - uses: actions/checkout@v2
  36. - uses: actions/checkout@v2
  37. with:
  38. repository: libbpf/libbpf
  39. path: libbpf
  40. - uses: actions-rs/toolchain@v1
  41. with:
  42. toolchain: nightly
  43. components: rustfmt, clippy, rust-src
  44. target: x86_64-unknown-linux-musl
  45. override: true
  46. - uses: Swatinem/rust-cache@v1
  47. - name: Install Pre-requisites
  48. run: |
  49. sudo apt-get -qy install linux-tools-common qemu-system-x86 cloud-image-utils openssh-client libelf-dev gcc-multilib
  50. cargo install bpf-linker
  51. - name: Lint integration tests
  52. run: |
  53. cargo xtask build-integration-test-ebpf --libbpf-dir ./libbpf
  54. cargo clippy -p integration-test -- --deny warnings
  55. cargo clippy -p integration-test-macros -- --deny warnings
  56. - name: Run integration tests
  57. run: |
  58. (cd test && ./run.sh ../libbpf)