Skip to content

Run the same test job across all operating systems #4590

Run the same test job across all operating systems

Run the same test job across all operating systems #4590

Workflow file for this run

name: go
on:
push:
branches:
- main
pull_request:
jobs:
# if: ${{ github.ref == 'refs/heads/main' }}
test:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
cgo: ['1', '0']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- 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 ./...
run: go install ./...
env:
CGO_ENABLED: ${{ matrix.cgo_enabled }}
- name: build internal/endtoend
run: go build ./...
working-directory: internal/endtoend/testdata
env:
CGO_ENABLED: ${{ matrix.cgo_enabled }}
- 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_enabled }}
vuln_check:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
- run: govulncheck ./...