gen.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: codegen
  2. on:
  3. push:
  4. branches-ignore: 'create-pull-request/**'
  5. schedule:
  6. - cron: 00 4 * * *
  7. workflow_dispatch:
  8. jobs:
  9. codegen:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v4
  13. with:
  14. submodules: recursive
  15. - uses: dtolnay/rust-toolchain@nightly
  16. with:
  17. components: rustfmt, clippy
  18. - uses: Swatinem/rust-cache@v2
  19. - name: Install headers
  20. run: |
  21. set -euxo pipefail
  22. sudo apt -y update
  23. sudo apt -y install libelf-dev libc6-dev libc6-dev-{arm64,armel,loong64,riscv64,ppc64el,s390x,mips}-cross
  24. - run: cargo xtask codegen
  25. # aya-ebpf-bindings aren't emitted directly from bindgen and so aren't formatted.
  26. - run: cargo fmt --all
  27. - run: cargo xtask public-api --bless
  28. - id: libbpf
  29. working-directory: xtask/libbpf
  30. run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
  31. - uses: peter-evans/create-pull-request@v7
  32. with:
  33. # GitHub actions aren't allowed to trigger other actions to prevent
  34. # abuse; the canonical workaround is to use a sufficiently authorized
  35. # token.
  36. #
  37. # See https://github.com/peter-evans/create-pull-request/issues/48.
  38. token: ${{ secrets.CRABBY_GITHUB_TOKEN }}
  39. branch: create-pull-request/codegen
  40. commit-message: |
  41. aya-obj, aya-ebpf-bindings: regenerate
  42. libbpf commit: ${{ steps.libbpf.outputs.sha }}
  43. title: 'aya-obj, aya-ebpf-bindings: regenerate'
  44. body: |
  45. **Automated changes**
  46. libbpf commit: ${{ steps.libbpf.outputs.sha}}