Skip to content

Commit cd73bf7

Browse files
kyleconroyclaude
andcommitted
Run goldeneye from a manual workflow instead of CI
Drop the check dialects job from ci.yml and replace gen.yml with a goldeneye workflow that only runs on workflow_dispatch, choosing between checking the committed dialect files against the databases and generating them and uploading the result. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrrewZQhCf82hp68FWNFLj
1 parent 3ee93ae commit cd73bf7

4 files changed

Lines changed: 64 additions & 65 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,36 +66,6 @@ jobs:
6666
MYSQL_SERVER_URI: "root:mysecretpassword@tcp(127.0.0.1:3306)/mysql?multiStatements=true&parseTime=true"
6767
CGO_ENABLED: "0"
6868

69-
goldeneye:
70-
name: check dialects
71-
runs-on: ubuntu-24.04
72-
services:
73-
postgres:
74-
image: postgres:16
75-
env:
76-
POSTGRES_USER: postgres
77-
POSTGRES_PASSWORD: postgres
78-
POSTGRES_DB: postgres
79-
ports:
80-
- 5432:5432
81-
# needed because the postgres container does not provide a healthcheck
82-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
83-
steps:
84-
- uses: actions/checkout@v7
85-
- uses: actions/setup-go@v7
86-
with:
87-
go-version: '1.26.5'
88-
89-
- name: install clickhouse
90-
run: go run ./cmd/goldeneye install clickhouse
91-
working-directory: internal/goldeneye
92-
93-
- name: test internal/goldeneye
94-
run: go test ./...
95-
working-directory: internal/goldeneye
96-
env:
97-
POSTGRESQL_SERVER_URI: postgres://postgres:postgres@localhost:${{ job.services.postgres.ports['5432'] }}/postgres?sslmode=disable
98-
9969
vuln_check:
10070
runs-on: ubuntu-24.04
10171
timeout-minutes: 5

.github/workflows/gen.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/goldeneye.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: goldeneye
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
command:
6+
description: check the committed dialect files against the databases, or generate them and upload the result
7+
type: choice
8+
options:
9+
- check
10+
- generate
11+
default: check
12+
jobs:
13+
goldeneye:
14+
name: ${{ inputs.command }} dialects
15+
runs-on: ubuntu-24.04
16+
services:
17+
postgres:
18+
image: postgres:16
19+
env:
20+
POSTGRES_USER: postgres
21+
POSTGRES_PASSWORD: postgres
22+
POSTGRES_DB: postgres
23+
ports:
24+
- 5432:5432
25+
# needed because the postgres container does not provide a healthcheck
26+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
27+
env:
28+
POSTGRESQL_SERVER_URI: postgres://postgres:postgres@localhost:${{ job.services.postgres.ports['5432'] }}/postgres?sslmode=disable
29+
defaults:
30+
run:
31+
working-directory: internal/goldeneye
32+
steps:
33+
- uses: actions/checkout@v7
34+
- uses: actions/setup-go@v7
35+
with:
36+
go-version-file: internal/goldeneye/go.mod
37+
check-latest: true
38+
39+
- name: install clickhouse
40+
run: go run ./cmd/goldeneye install clickhouse
41+
42+
- name: check
43+
if: inputs.command == 'check'
44+
run: go test -v ./...
45+
46+
- name: generate
47+
if: inputs.command == 'generate'
48+
run: go run ./cmd/goldeneye generate
49+
50+
- name: show changes
51+
if: inputs.command == 'generate'
52+
run: git status --short && git diff --stat
53+
working-directory: .
54+
55+
- name: upload dialects
56+
if: inputs.command == 'generate'
57+
uses: actions/upload-artifact@v7
58+
with:
59+
name: dialects
60+
path: internal/engine/*/dialect

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ POSTGRESQL_SERVER_URI="postgres://postgres:postgres@127.0.0.1:5432/postgres?sslm
157157
go run ./cmd/goldeneye generate postgresql # rewrite the files after a change
158158
```
159159

160+
The checks are not part of CI. The `goldeneye` workflow
161+
(`.github/workflows/goldeneye.yml`) runs them on demand, or generates the
162+
files and uploads them as an artifact.
163+
160164
### Example Tests
161165

162166
- **Location:** `/examples/` directory

0 commit comments

Comments
 (0)