Update bundled XML and headers #25
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: Update bundled XML and headers | |
| on: | |
| schedule: | |
| # Every Monday at 05:00 UTC. | |
| - cron: "0 5 * * 1" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update: | |
| name: Fetch and validate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Fetch bundled files | |
| # Runs `cargo xtask bundle`, which resolves every source at upstream HEAD | |
| # via the GitHub API and writes bundled/ + bundled/provenance.json. | |
| # The token lifts the API rate limit (1000 req/hr vs 60 unauthenticated). | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: ./scripts/fetch_bundled.sh | |
| - name: Build with updated files | |
| # This is the primary validity check: include_str! will fail at | |
| # compile time if any fetched file is empty or missing. | |
| run: cargo build --release --no-default-features | |
| - name: Re-bless golden snapshots | |
| # tests/golden.rs pins generated output byte-for-byte. A spec update | |
| # that changes resolved content must re-bless the snapshots in the | |
| # same PR — the tests/golden/ diff then documents exactly how the new | |
| # specs changed generated output, alongside the bundle diff itself. | |
| env: | |
| GLOAM_BLESS: "1" | |
| run: cargo test --release --no-default-features --test golden | |
| - name: Run test suite against updated files | |
| run: cargo test --release --no-default-features | |
| # Build a human-readable provenance summary (one line per upstream repo, | |
| # with its git describe) for the PR body, straight from the manifest the | |
| # bundler just wrote. | |
| - name: Summarize provenance | |
| id: prov | |
| run: | | |
| set -euo pipefail | |
| { | |
| echo "summary<<PROV_EOF" | |
| jq -r ' | |
| .provenance | |
| | to_entries | map(.value) | |
| | group_by(.repo)[] | |
| | "- `\(.[0].repo)` @ commit `\(.[0].commit[0:12])`" | |
| ' bundled/provenance.json | sort | |
| echo "PROV_EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Open pull request | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| add-paths: | | |
| bundled/ | |
| tests/golden/ | |
| commit-message: | | |
| chore: update bundled specs, headers, and provenance | |
| Refresh bundled/ from upstream via `cargo xtask bundle`, and | |
| re-bless the golden output snapshots against the new specs. | |
| Pinned upstream sources: | |
| ${{ steps.prov.outputs.summary }} | |
| title: "chore: update bundled specs, headers, and provenance" | |
| body: | | |
| Automated weekly refresh of `bundled/` (XML specs, auxiliary | |
| headers, and `bundled/provenance.json`) via `cargo xtask bundle`. | |
| The build and test suite passed against the new files before this | |
| PR was opened, and the golden output snapshots were re-blessed. | |
| ### Pinned upstream sources | |
| ${{ steps.prov.outputs.summary }} | |
| Per-file blob hashes and exact commits are recorded in | |
| `bundled/provenance.json`; review its diff to see precisely what | |
| moved. Any diff under `tests/golden/` shows exactly how the new | |
| specs change generated loader output; no golden diff means the | |
| update is output-neutral for the snapshot configs. | |
| branch: update-bundled-xml | |
| delete-branch: true | |
| labels: dependencies |