mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-06 17:47:00 +00:00
It is useful to run the integration tests both against the submitted dependencies, based on Go module versions from the repository, as well as the latest ones, to catch integration problems early. This patch extends the .gitlab-ci.yml configuration to do that, by optionally passing a flag to "go get" to update the modules.
40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
|
|
stages:
|
|
- test
|
|
- docker_image
|
|
|
|
# Integration test, using the module versions from the repository.
|
|
integration_test:
|
|
stage: test
|
|
image: docker:stable
|
|
services:
|
|
- docker:dind
|
|
script:
|
|
- docker info
|
|
- docker build -t chasquid-test -f test/Dockerfile .
|
|
- docker run chasquid-test env
|
|
- docker run chasquid-test make test
|
|
|
|
# Integration test, using the latest module versions.
|
|
integration_test_latest:
|
|
stage: test
|
|
image: docker:stable
|
|
services:
|
|
- docker:dind
|
|
script:
|
|
- docker info
|
|
- docker build -t chasquid-test --build-arg GO_GET_ARGS="-u=patch" -f test/Dockerfile .
|
|
- docker run chasquid-test env
|
|
- docker run chasquid-test make test
|
|
|
|
image_build:
|
|
stage: docker_image
|
|
image: docker:stable
|
|
services:
|
|
- docker:dind
|
|
script:
|
|
- docker info
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
- docker build -t $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME -f docker/Dockerfile .
|
|
- docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
|