Skip to content

fix codegen for database/sql #1

fix codegen for database/sql

fix codegen for database/sql #1

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
build-and-verify:
runs-on: ubuntu-latest
steps:
- name: Checkout sqlc-ydb
uses: actions/checkout@v4
with:
path: sqlc-ydb
- name: Checkout engine-plugin
uses: actions/checkout@v4
with:
repository: sqlc-dev/engine-plugin
path: engine-plugin
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Install protoc
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
- name: Build plugins and sqlc
working-directory: sqlc-ydb
env:
PATH: ${{ github.workspace }}/sqlc-ydb/bin:${{ env.PATH }}
run: |
make proto
make build
make build-sqlc
- name: Run unit tests
working-directory: sqlc-ydb
run: go test ./internal/...
- name: Generate code in examples
working-directory: sqlc-ydb
env:
PATH: ${{ github.workspace }}/sqlc-ydb/bin:${{ env.PATH }}
run: make examples
- name: Verify no generated code changes (git diff)
working-directory: sqlc-ydb
run: |
git config --global user.email "ci@example.com"
git config --global user.name "CI"
git add -A
if ! git diff --exit-code --quiet HEAD; then
echo "::error::Generated code differs from committed files. Run 'make examples' and commit the changes."
git diff HEAD
exit 1
fi
echo "Generated code matches committed files."