Repository navigation
regenerate #4
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: regenerate | |
| # Scheduled proof that the committed goldens are reproducible byte-for-byte | |
| # from the pinned oracle (libpg_query 18.0.0 via pg_query_go's wrapper, cgo). | |
| # This is the only place cgo ever runs; the main module never links it. | |
| on: | |
| schedule: | |
| - cron: "17 6 * * 1" # weekly, Monday 06:17 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| regenerate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install protoc (for the oracle's pg_query_go build) | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - name: Fetch pinned corpus | |
| run: | | |
| git clone --depth 1 --branch 18.0.0 https://github.com/pganalyze/libpg_query /tmp/libpg_query | |
| - name: Build the oracle's pg_query_go dependency | |
| # No pg_query_go release ships libpg_query 18 yet; this reproduces | |
| # pg_query_go's `make update_source` against the pinned tag. | |
| run: ./oracle/update-pg-query-go.sh /tmp/libpg_query | |
| - name: Regenerate goldens (builds the cgo oracle; several minutes) | |
| run: | | |
| go run ./cmd/regenerate -libpg-query /tmp/libpg_query -pg-query-go oracle/pg_query_go | |
| - name: Goldens are reproducible | |
| run: git diff --exit-code -- parser/testdata |