-
Notifications
You must be signed in to change notification settings - Fork 250
61 lines (49 loc) · 1.7 KB
/
gen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: codegen
on: workflow_dispatch
jobs:
codegen:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: libbpf/libbpf
path: libbpf
- name: libbpf-version
working-directory: libbpf
run: echo "LIBBPF_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- name: Install headers
run: |
sudo apt -y update
sudo apt -y install libc6-dev libc6-dev-{arm64,armel,riscv64}-cross
- name: Run codegen
run: |
cargo xtask codegen --libbpf-dir ./libbpf
- 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