41ac92086a
What is a CI/CD system if it cannot test itself?
68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
runtimes:
|
|
go1.12:
|
|
type: pod
|
|
arch: amd64
|
|
containers:
|
|
- image: golang:1.12-stretch
|
|
debian:
|
|
type: pod
|
|
arch: amd64
|
|
containers:
|
|
- image: debian:stretch
|
|
dind:
|
|
type: pod
|
|
arch: amd64
|
|
containers:
|
|
- image: docker:stable-dind
|
|
privileged: true
|
|
entrypoint: dockerd
|
|
|
|
tasks:
|
|
build-go1.12:
|
|
runtime: go1.12
|
|
working_dir: /go/src/github.com/sorintlab/agola
|
|
environment:
|
|
GO111MODULE: "on"
|
|
steps:
|
|
- run: env
|
|
- clone:
|
|
- run: SKIP_DOCKER_TESTS=1 go test -v -count 1 ./...
|
|
|
|
build-docker-tests-go-1.12:
|
|
runtime: go1.12
|
|
working_dir: /go/src/github.com/sorintlab/agola
|
|
environment:
|
|
GO111MODULE: "on"
|
|
steps:
|
|
- run: env
|
|
- clone:
|
|
- run:
|
|
name: build docker tests binary
|
|
command: CGO_ENABLED=0 go test -c ./internal/services/runservice/executor/driver -o ./bin/docker-tests
|
|
- save_to_workspace:
|
|
contents:
|
|
- source_dir: ./bin
|
|
dest_dir: /bin/
|
|
paths:
|
|
- "*"
|
|
|
|
test-docker-driver:
|
|
runtime: dind
|
|
steps:
|
|
- run: env
|
|
- restore_workspace:
|
|
dest_dir: .
|
|
- run: sleep 5
|
|
- run: ./bin/docker-tests -test.parallel 1 -test.v
|
|
|
|
pipelines:
|
|
agola build/test:
|
|
elements:
|
|
build go1.12:
|
|
task: build-go1.12
|
|
build docker tests go1.12:
|
|
task: build-docker-tests-go-1.12
|
|
test docker driver:
|
|
task: test-docker-driver
|
|
depends:
|
|
- build docker tests go1.12 |