Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test matrix
  • Loading branch information
anuraaga committed Dec 5, 2023
commit ce0fa99dcf610106a6e2964300c322b4855dbb93
76 changes: 21 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,22 @@ on:
- main
pull_request:
jobs:
windows-build:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true

# Currently some tests rely on line endings so we only build
# without running.
- run: go build ./...

darwin-test:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true

- name: install sqlc-gen-test
run: go install github.com/sqlc-dev/[email protected]

- name: install ./...
run: go install ./...

- run: go test ./...

linux-purego-test:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true

- name: install sqlc-gen-test
run: go install github.com/sqlc-dev/[email protected]

- name: install ./...
run: go install ./...

- run: go test ./...
env:
CGO_ENABLED: '0'

build:
name: test
runs-on: ubuntu-latest
test:
strategy:
max-parallel: 2
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
cgo: ['1', '0']
# Workaround no proper 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-latest, cgo: '1' }
- { os: ubuntu-latest, cgo: '0' }
name: Test ${{ matrix.os }}-cgo${{ matrix.cgo }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -76,17 +37,22 @@ jobs:

- 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-latest
Expand Down