build-aya.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. sudo apt-get -qy install linux-tools-common qemu-system-x86 cloud-image-utils openssh-client libelf-dev gcc-multilib
  57. cargo install bpf-linker
  58. - name: Lint integration tests
  59. run: |
  60. cargo xtask build-integration-test-ebpf --libbpf-dir ./libbpf
  61. cargo clippy -p integration-test -- --deny warnings
  62. - name: Run integration tests
  63. run: |
  64. (cd test && ./run.sh ../libbpf)