-
Notifications
You must be signed in to change notification settings - Fork 266
96 lines (92 loc) · 2.57 KB
/
ci-go_oss.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# # # # # # # # # # # # # # # #
# CODE GENERATED - DO NOT EDIT
# # # # # # # # # # # # # # # #
name: CI - General - Community Edition
on:
pull_request:
paths-ignore:
- 'doc/**'
- 'ops/**'
push:
branches:
- master
paths-ignore:
- 'doc/**'
- 'ops/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.22'
- uses: actions/checkout@v2
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
args: --verbose
generate-cmp:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v4
with:
go-version-file: cmd/atlas/go.mod
- name: Install stringer
run: go install golang.org/x/tools/cmd/stringer@latest
- name: run "go generate ./..."
run: go generate ./...
- name: go generate cmd/atlas
working-directory: cmd/atlas
run: go generate ./...
- name: Verify generated files are checked-in properly
run: |
status=$(git status --porcelain | grep -v "go.\(sum\|mod\)" | cat)
if [ -n "$status" ]; then
echo "you need to run 'go generate ./...' and commit the changes"
echo "$status"
exit 1
fi
unit:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ "1.22" ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Run sql tests
run: go test -race ./...
working-directory: sql
- name: Run schemahcl tests
run: go test -race ./...
working-directory: schemahcl
cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v4
with:
go-version-file: cmd/atlas/go.mod
- name: Run cli tests
run: go test -race ./...
working-directory: cmd/atlas
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v4
with:
go-version-file: cmd/atlas/go.mod
- name: Run integration tests for HCL
working-directory: internal/integration/hclsqlspec
run: go test -race -count=2 -v ./...
dialect-integration:
needs: [lint, generate-cmp, unit, cli, integration]
uses: ./.github/workflows/ci-dialect_oss.yaml
secrets: inherit