From 41ac92086af4e69bc491cd0128dc4eef37c8618b Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Wed, 13 Mar 2019 12:14:55 +0100 Subject: [PATCH] *: test on itself What is a CI/CD system if it cannot test itself? --- .agola/config.yml | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .agola/config.yml diff --git a/.agola/config.yml b/.agola/config.yml new file mode 100644 index 0000000..1bc1df8 --- /dev/null +++ b/.agola/config.yml @@ -0,0 +1,68 @@ +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 \ No newline at end of file