Repository navigation
Refresh SQLite BTF blobs #1
This file contains hidden or 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: 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 |