-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (67 loc) · 1.94 KB
/
main.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
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.22', '1.x' ]
name: With Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test
run: go test -race ./...
static-checks:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.x' ]
name: Static checks
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Go Vet
run: go vet ./...
- name: Goimports
run: |
go run golang.org/x/tools/cmd/goimports@latest -w .
git diff --quiet || (echo 'goimports requires code cleanup:' ; git diff ; exit 1)
- name: Go Generate
run: |
go generate ./...
# Bug in swag results in Flaky swagger docs - see https://github.com/swaggo/swag/issues/721
# git diff --quiet || (echo 'generated go files are not up to date, check go generate, go.sum and go.mod' ; git diff ; exit 1)
git diff --quiet -- . ":(exclude)docs" || (echo 'generated go files are not up to date, check go generate, go.sum and go.mod' ; git diff -- . ":(exclude)docs"; exit 1)
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.x' ]
name: Integration
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Get dependencies
run: go get -v -t -d ./...
- name: Generate GraphQL
run: make generate-integrationtest-graphql
- name: Test
run: make integrationtest