forked from sqlc-dev/sqlc
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 1.87 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: go
on:
push:
branches:
- main
pull_request:
jobs:
test:
strategy:
max-parallel: 2
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
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-latest
cgo: '1'
- os: ubuntu-latest
cgo: '0'
name: test ${{ matrix.os }} cgo=${{ matrix.cgo }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
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/sqlc-gen-test@v0.1.0
- 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
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
- run: govulncheck ./...