Skip to content

test(endtoend): Use Docker to start database servers #5676

test(endtoend): Use Docker to start database servers

test(endtoend): Use Docker to start database servers #5676

Workflow file for this run

name: go
on:
push:
branches:
- main
pull_request:
jobs:
test:
strategy:
matrix:
# Disabling windows builds while we fix installing PostgreSQL 16
os: [ubuntu-22.04, macos-14, windows-2022]
cgo: ['1', '0']
# Workaround no native support for conditional matrix items
# https://github.com/orgs/community/discussions/26253#discussioncomment-6745038
# isMain:
# - ${{ github.ref == 'refs/heads/main' }}
# exclude:
# - isMain: false
# include:
# - os: ubuntu-22.04
# cgo: '1'
# - os: ubuntu-22.04
# cgo: '0'
name: test ${{ matrix.os }} cgo=${{ matrix.cgo }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v5
with:
go-version: '1.25.0'
- name: install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: install sqlc-gen-test
run: go install github.com/sqlc-dev/[email protected]
- name: install test-json-process-plugin
run: go install ./scripts/test-json-process-plugin/
- name: install ./...
run: go install ./...
env:
CGO_ENABLED: ${{ matrix.cgo }}
- name: build internal/endtoend
run: go build ./...
working-directory: internal/endtoend/testdata
env:
CGO_ENABLED: ${{ matrix.cgo }}
- name: test ./...
run: gotestsum --junitfile junit.xml -- --tags=examples -timeout 20m ./...
env:
CI_SQLC_PROJECT_ID: ${{ secrets.CI_SQLC_PROJECT_ID }}
CI_SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }}
SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }}
CGO_ENABLED: ${{ matrix.cgo }}
vuln_check:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: golang/govulncheck-action@v1