configuration of ci
This commit is contained in:
parent
0c2015ad7a
commit
1c6f792711
2 changed files with 31 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ depends_on:
|
||||||
- test
|
- test
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &golang_image 'docker.io/golang:1.22.0'
|
- &golang_image 'golang:1.22.0'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
"Add vendor":
|
"Add vendor":
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,9 @@ when:
|
||||||
- renovate/*
|
- renovate/*
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &golang_image 'docker.io/golang:1.22.0'
|
- &golang_image 'golang:1.22.0'
|
||||||
|
- &mysql_image 'mysql:8.2.0'
|
||||||
|
- &postgres_image 'postgres:16'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
"Add vendor":
|
"Add vendor":
|
||||||
|
|
@ -15,7 +17,34 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- go mod vendor
|
- go mod vendor
|
||||||
|
|
||||||
|
"Wait databases":
|
||||||
|
image: gitnet.fr/deblan/timeout:latest
|
||||||
|
commands:
|
||||||
|
- /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 3306 2>&1 | grep succeeded && exit 0; sleep 0.5; done'
|
||||||
|
- /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 5432 2>&1 | grep succeeded && exit 0; sleep 0.5; done'
|
||||||
|
|
||||||
|
"Fill MySQL"
|
||||||
|
image: *mysql_image
|
||||||
|
commands:
|
||||||
|
- mysql test < tests/mysql_data.sql
|
||||||
|
|
||||||
"Run tests":
|
"Run tests":
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- go test -v ./...
|
- go test -v ./...
|
||||||
|
|
||||||
|
services:
|
||||||
|
service-postgres:
|
||||||
|
image: *postgres_image
|
||||||
|
ports: ['5432']
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=postgres
|
||||||
|
- POSTGRES_HOST_AUTH_METHOD=trust
|
||||||
|
when: *when
|
||||||
|
|
||||||
|
service-mysql:
|
||||||
|
image: *mysql_image
|
||||||
|
ports: ['3306']
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE=test
|
||||||
|
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue