-
Notifications
You must be signed in to change notification settings - Fork 14
62 lines (62 loc) · 1.74 KB
/
ci.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
name: Go Continuous Integration
on:
push:
branches:
- master
pull_request:
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Run Go linters
uses: golangci/golangci-lint-action@v3
with:
args: --verbose --timeout=5m
skip-pkg-cache: true
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Run tests
run: go test -race ./...
integration-test:
strategy:
matrix:
dialect: [mysql, postgres, sqlite, sqlserver]
go: ['1.21', '1.22']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- run: |
curl -sSf 'https://atlasgo.sh?test=1' | sh
env:
ATLAS_DEBUG: true
- working-directory: internal/testdata
run: |
atlas migrate diff --env gorm --var dialect=${{ matrix.dialect }}
env:
ATLAS_TOKEN: ${{ secrets.ATLAS_TOKEN }}
- working-directory: internal/testdata/circularfks
run: |
atlas migrate diff --env gorm --var dialect=${{ matrix.dialect }}
env:
ATLAS_TOKEN: ${{ secrets.ATLAS_TOKEN }}
- name: Verify migrations generated
run: |
status=$(git status --porcelain)
if [ -n "$status" ]; then
echo "you need to run 'atlas migrate diff --env gorm' and commit the changes"
echo "$status"
git --no-pager diff
exit 1
fi