test.yaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: CI
  2. on:
  3. pull_request: {}
  4. push:
  5. branches:
  6. - master
  7. jobs:
  8. build_and_test:
  9. name: Build and test package
  10. runs-on: ubuntu-latest
  11. env:
  12. # Exclude features not supported by rbpf yet.
  13. # 32-bit jump - https://github.com/qmonnet/rbpf/issues/47
  14. # atomic operations - https://github.com/qmonnet/rbpf/issues/47
  15. # mem-len - Tests assume r2 contains the length of the memory.
  16. KNOWN_FAILURES: "(j.*32|lock|by-zero|mem-len)"
  17. strategy:
  18. matrix:
  19. include:
  20. - toolchain: stable
  21. - toolchain: beta
  22. - toolchain: nightly
  23. steps:
  24. - name: Checkout code
  25. uses: actions/checkout@v3
  26. - name: Install toolchain (${{ matrix.toolchain }})
  27. uses: actions-rs/toolchain@v1
  28. with:
  29. toolchain: ${{ matrix.toolchain }}
  30. override: true
  31. components: clippy
  32. - name: Build with ${{ matrix.toolchain }}
  33. uses: actions-rs/cargo@v1
  34. with:
  35. command: build
  36. args: --release --all-features --all-targets
  37. - name: Test with ${{ matrix.toolchain }}
  38. uses: actions-rs/cargo@v1
  39. with:
  40. command: test
  41. - name: Lint with ${{ matrix.toolchain }}
  42. uses: actions-rs/cargo@v1
  43. with:
  44. command: clippy
  45. - name: Run BPF conformance tests - Interpreter
  46. run: |
  47. docker run -v ${{github.workspace}}:/rbpf --rm \
  48. ghcr.io/alan-jowett/bpf_conformance@sha256:b88246eee0474f0a114fedadd7b9d8c79940647f44b0e499dfd10e70d1300a6f \
  49. bin/bpf_conformance_runner --test_file_directory tests \
  50. --plugin_path /rbpf/target/release/examples/rbpf_plugin \
  51. --exclude_regex "${{ env.KNOWN_FAILURES }}"
  52. # JIT tests results are ignored due to https://github.com/qmonnet/rbpf/issues/60
  53. - name: Run BPF conformance tests - JIT
  54. run: |
  55. docker run -v ${{github.workspace}}:/rbpf --rm \
  56. ghcr.io/alan-jowett/bpf_conformance@sha256:b88246eee0474f0a114fedadd7b9d8c79940647f44b0e499dfd10e70d1300a6f \
  57. bin/bpf_conformance_runner --test_file_directory tests \
  58. --plugin_path /rbpf/target/release/examples/rbpf_plugin \
  59. --exclude_regex "${{ env.KNOWN_FAILURES }}" \
  60. --plugin_options "--jit" || true