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..3b2e873 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ Go package for parsing SQLite or SQL-92 queries. +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 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