-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (53 loc) · 2.12 KB
/
Copy pathbtf-refresh.yml
File metadata and controls
60 lines (53 loc) · 2.12 KB
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
name: Refresh SQLite BTF blobs
# gen_btf.sh scrapes sqlite.org's chronology for every release and builds the
# per-version BTF blobs the loader needs. It is idempotent (skips versions whose
# blob already exists), so a scheduled run only does work when SQLite has shipped
# a release not yet committed under .btf-cache. New blobs + the regenerated
# sqlite-sources.tsv are committed back to the branch.
on:
schedule:
# Mondays 06:00 UTC. SQLite releases only a handful of times a year, so weekly
# polling is ample; the run is a no-op (just the chronology fetch) when nothing
# new shipped.
- cron: "0 6 * * 1"
workflow_dispatch:
inputs:
force:
description: "Rebuild every blob even if it already exists (FORCE=1)"
type: boolean
default: false
permissions:
contents: write
concurrency:
group: btf-refresh
cancel-in-progress: false
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# cc + unzip are already on the runner; dwarves provides pahole, which
# gen_btf.sh uses to emit .BTF into the compiled amalgamation.
- name: Install build deps
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq dwarves unzip
# OUT_DIR points at the committed canonical store (.btf-cache); the loader
# resolves it relative to the binary, so build/btf is only a local symlink.
- name: Generate missing BTF blobs
env:
OUT_DIR: ${{ github.workspace }}/.btf-cache
FORCE: ${{ inputs.force && '1' || '' }}
run: ./gen_btf.sh
- name: Commit new blobs
run: |
if git diff --quiet -- .btf-cache; then
echo "No BTF changes; nothing to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .btf-cache
added=$(git diff --cached --name-only --diff-filter=A -- '.btf-cache/sqlite-*.btf' | wc -l | tr -d ' ')
git commit -m "ci: refresh SQLite BTF blobs (${added} new)"
git push