codegen #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: codegen | |
on: workflow_dispatch | |
jobs: | |
codegen: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: update libbpf | |
working-directory: xtask/libbpf | |
run: | | |
set -e | |
git fetch origin | |
git checkout origin/HEAD | |
echo "LIBBPF_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install headers | |
continue-on-error: true | |
run: | | |
sudo apt-get -y update | |
sudo apt -y install linux-headers-`uname -r` libelf-dev libc6-dev libc6-dev-{arm64,armel,riscv64,ppc64el,s390x}-cross | |
sudo dpkg --add-architecture arm64 | |
sudo dpkg --add-architecture armel | |
sudo dpkg --add-architecture riscv64 | |
sudo dpkg --add-architecture ppc64el | |
sudo dpkg --add-architecture s390x | |
sudo apt-get -y update | |
- name: Run codegen | |
run: | | |
cargo xtask codegen | |
- name: Check for changes | |
run: | | |
git diff --quiet || echo "COMMIT_CHANGES=1" >> $GITHUB_ENV | |
- name: Commit Changes | |
id: commit | |
if: env.COMMIT_CHANGES == 1 | |
uses: devops-infra/action-commit-push@master | |
with: | |
github_token: "${{ secrets.CRABBY_GITHUB_TOKEN }}" | |
commit_prefix: "[codegen] Update libbpf to ${{ env.LIBBPF_SHA }}" | |
commit_message: "Update libbpf to ${{ env.LIBBPF_SHA }}" | |
target_branch: codegen | |
force: true | |
- name: Create pull request | |
if: steps.commit.outputs.files_changed != '' | |
uses: devops-infra/action-pull-request@master | |
with: | |
github_token: ${{ secrets.CRABBY_GITHUB_TOKEN }} | |
body: "**Automated pull request**<br><br>Update libbpf to ${{ env.LIBBPF_SHA }}" | |
title: Update libbpf to ${{ env.LIBBPF_SHA }} | |
source_branch: codegen | |
target_branch: main | |
get_diff: true |