From 2d5633cba0fd05026f8da4aaa702df03dc7297df Mon Sep 17 00:00:00 2001 From: Jin Xu Date: Fri, 6 Nov 2026 19:28:05 +0800 Subject: [PATCH 1/2] Add reproducible module tooling and GitHub Actions Declare the self-contained module without raising its language baseline beyond Go 1.11. Pin the generator that reproduces sql.go byte for byte. Replace the inactive Travis configuration and obsolete coverage tool installations with build, regeneration, vet, and test checks. --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ .travis.yml | 17 ----------------- Makefile | 3 ++- README.md | 4 ++++ go.mod | 3 +++ 5 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100644 go.mod diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b24d162 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.27.x' + cache: false + - run: go build ./... + - run: make -B sql.go + - run: git diff --exit-code -- sql.go + - run: go vet ./... + - run: go test -count=1 ./... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 43c9baf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -dist: trusty -sudo: false - -language: go -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - -before_install: - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover - - go install golang.org/x/tools/cmd/goyacc - -script: - - travis_retry $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/Makefile b/Makefile index 215f422..6c8dd66 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,10 @@ # limitations under the License. MAKEFLAGS = -s +GOYACC = go run golang.org/x/tools/cmd/goyacc@v0.0.0-20180926032708-9eb9690e392a sql.go: sql.y - goyacc -o sql.go sql.y + $(GOYACC) -o sql.go sql.y gofmt -w sql.go clean: diff --git a/README.md b/README.md index d043b72..1e3c6cc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ Go package for parsing SQLite or SQL-92 queries. +The module supports Go 1.11 and later. Regenerate `sql.go` with +`make -B sql.go` using Go 1.16 or later; the Makefile pins the generator +that reproduces the committed parser byte for byte. + ## Notice The backbone of this repo is extracted from [vitessio/vitess](https://github.com/vitessio/vitess). diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..60a7c18 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/CovenantSQL/sqlparser + +go 1.11 From 718c774122ae31d00f02b136837a4fbf71045412 Mon Sep 17 00:00:00 2001 From: Jin Xu Date: Fri, 6 Nov 2026 20:06:27 +0800 Subject: [PATCH 2/2] Correct the parser regeneration toolchain requirement The module builds with Go 1.11, but versioned go run requires Go 1.17. Document the consumer and generator requirements separately without raising the module language version. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e3c6cc..3b2e873 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,10 @@ Go package for parsing SQLite or SQL-92 queries. -The module supports Go 1.11 and later. Regenerate `sql.go` with -`make -B sql.go` using Go 1.16 or later; the Makefile pins the generator -that reproduces the committed parser byte for byte. +The module builds with Go 1.11 and later. Regenerating `sql.go` with +`make -B sql.go` requires Go 1.17 or later for versioned `go run` support. +The Makefile pins the generator that reproduces the committed parser byte +for byte. ## Notice