1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-08 17:51:57 +00:00
Files
go-chasquid-smtp/.gitlab-ci.yml
Alberto Bertogli 4efe8db947 Update minimum supported Go version 1.15 -> 1.17
The latest version of some packages we depend on (golang.org/x/sys,
indirectly) do not support 1.15 anymore.

We kept 1.15 because it's the version on Debian stable, but that release
is more than 2y old, and newer versions are readily available in Debian
stable backports.

So this patch updates the minimum supported Go version to 1.17.
2022-11-12 18:41:40 +00:00

103 lines
2.8 KiB
YAML

stages:
- test
- image
# Go tests, on various Go versions.
.golang_template: &golang
stage: test
before_script:
- useradd --create-home --user-group testing
- chown -R testing:testing $GOPATH/ .
script:
- su testing -c "go mod download"
- su testing -c "go get ./..."
- su testing -c "make all"
- su testing -c "go test ./..."
- su testing -c "go test -race ./..."
golang_1.17:
<<: *golang
image: golang:1.17 # Oldest supported Go version.
golang_latest:
<<: *golang
image: golang:latest
# Integration test, using the module versions from the repository.
integration_stable:
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 --name test1 chasquid-test make test
after_script:
- docker cp test1:/go/src/blitiri.com.ar/go/chasquid docker-out/
artifacts:
when: always
expire_in: 1 hour
paths:
- docker-out/
# Integration test, using the latest module versions.
integration_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 --name test1 chasquid-test make test
after_script:
- docker cp test1:/go/src/blitiri.com.ar/go/chasquid docker-out/
artifacts:
when: always
expire_in: 1 hour
paths:
- docker-out/
# Build docker image, upload to gitlab registry.
gitlab:
stage: image
rules:
- if: '$CI_REGISTRY_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_COMMIT_REF_NAME -f docker/Dockerfile .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- |
if [ $CI_COMMIT_REF_NAME == master ]; then
docker tag $CI_REGISTRY_IMAGE:master $CI_REGISTRY_IMAGE:latest
docker push $CI_REGISTRY_IMAGE:latest
fi
# Build docker image, upload to dockerhub registry.
dockerhub:
stage: image
rules:
- if: '$DOCKER_REGISTRY_USER'
image: docker:stable
services:
- docker:dind
script:
- docker info
- docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD docker.io
- docker build -t index.docker.io/albertito/chasquid:$CI_COMMIT_REF_NAME -f docker/Dockerfile .
- docker push index.docker.io/albertito/chasquid:$CI_COMMIT_REF_NAME
- |
if [ $CI_COMMIT_REF_NAME == master ]; then
docker tag index.docker.io/albertito/chasquid:master index.docker.io/albertito/chasquid:latest
docker push index.docker.io/albertito/chasquid:latest
fi