forked from gobuffalo/fizz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-tests.yml
58 lines (58 loc) · 1.67 KB
/
azure-tests.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
steps:
- task: GoTool@0
inputs:
version: $(go_version)
- task: Bash@3
inputs:
targetType: inline
script: |
mkdir -p "$(GOBIN)"
mkdir -p "$(GOPATH)/pkg"
mkdir -p "$(modulePath)"
shopt -s extglob
mv !(gopath) "$(modulePath)"
displayName: "Setup Go Workspace"
- task: Docker@1
displayName: Run postgres image
inputs:
command: run
imageName: postgres:9.6
ports: "5432:5432"
envVars: POSTGRES_DB=pop_test
condition: and(succeeded(), eq(variables['SODA_DIALECT'], 'postgres'))
- task: Docker@1
displayName: Run mysql image
inputs:
command: run
imageName: mysql:5.7
ports: "3307:3306"
envVars: |
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=pop_test
MYSQL_USER=pop
MYSQL_PASSWORD=pop
condition: and(succeeded(), eq(variables['SODA_DIALECT'], 'mysql'))
- task: Docker@1
displayName: Run cockroach image
inputs:
command: run
imageName: cockroachdb/cockroach:v1.1.1
ports: "26257:26257"
containerCommand: start --insecure
condition: and(succeeded(), eq(variables['SODA_DIALECT'], 'cockroach'))
- task: Bash@3
inputs:
targetType: inline
script: |
GO111MODULE=off go get -v -tags sqlite github.com/gobuffalo/pop/soda
displayName: "Install soda"
- script: |
$(GOBIN)/soda create -e $(SODA_DIALECT)
$(GOBIN)/soda migrate -e $(SODA_DIALECT)
workingDirectory: "$(modulePath)"
displayName: "Create DB & run migrations"
- script: |
go get -t -v ./...
go test -race -v ./...
workingDirectory: "$(modulePath)"
displayName: "Tests"