github.com/dolanor/pop@v4.13.0+incompatible/azure-tests.yml (about) 1 steps: 2 - task: GoTool@0 3 inputs: 4 version: $(go_version) 5 - task: Bash@3 6 inputs: 7 targetType: inline 8 script: | 9 mkdir -p "$(GOBIN)" 10 mkdir -p "$(GOPATH)/pkg" 11 mkdir -p "$(modulePath)" 12 shopt -s extglob 13 mv !(gopath) "$(modulePath)" 14 displayName: "Setup Go Workspace" 15 - task: Docker@1 16 displayName: Run postgres image 17 inputs: 18 command: run 19 imageName: postgres:9.6 20 ports: "5432:5432" 21 condition: and(succeeded(), eq(variables['SODA_DIALECT'], 'postgres')) 22 - task: Docker@1 23 displayName: Run mysql image 24 inputs: 25 command: run 26 imageName: mysql:5.7 27 ports: "3307:3306" 28 envVars: | 29 MYSQL_ROOT_PASSWORD=root 30 condition: and(succeeded(), eq(variables['SODA_DIALECT'], 'mysql')) 31 - task: Docker@1 32 displayName: Run cockroach image 33 inputs: 34 command: run 35 imageName: cockroachdb/cockroach:v1.1.1 36 ports: "26257:26257" 37 containerCommand: start --insecure 38 condition: and(succeeded(), eq(variables['SODA_DIALECT'], 'cockroach')) 39 - task: Bash@3 40 displayName: Install Cockroach SSL 41 inputs: 42 targetType: inline 43 script: | 44 cd $(modulePath) 45 mkdir -p crdb/certs 46 pushd crdb 47 wget -qO- https://binaries.cockroachdb.com/cockroach-v2.1.0.linux-amd64.tgz | tar zxv 48 mv cockroach-v2.1.0.linux-amd64/cockroach . 49 ./cockroach cert create-ca --certs-dir certs --ca-key key 50 ./cockroach cert create-client root --certs-dir certs --ca-key key 51 ./cockroach cert create-node localhost 127.0.0.1 `hostname -s` `hostname -f` --certs-dir certs --ca-key key 52 ./cockroach start --certs-dir certs --listen-addr localhost --port 26259 --http-port 8089 --background 53 popd 54 condition: and(succeeded(), eq(variables['SODA_DIALECT'], 'cockroach_ssl')) 55 - script: | 56 go get -t -v ./... 57 go install -v -tags sqlite ./soda 58 workingDirectory: "$(modulePath)" 59 displayName: "Install soda" 60 - script: | 61 $(GOBIN)/soda drop -e $(SODA_DIALECT) -p ./testdata/migrations 62 $(GOBIN)/soda create -e $(SODA_DIALECT) -p ./testdata/migrations 63 $(GOBIN)/soda migrate -e $(SODA_DIALECT) -p ./testdata/migrations 64 workingDirectory: "$(modulePath)" 65 displayName: "Create DB & run migrations" 66 - script: | 67 go test -tags sqlite ./... -v 68 workingDirectory: "$(modulePath)" 69 displayName: "Tests"