Skip to content
Snippets Groups Projects
Commit 638d1422 authored by ale's avatar ale
Browse files

Clean up post-move, add a README

parent 48fad5b2
No related branches found
No related tags found
No related merge requests found
Pipeline #57018 passed
include: "https://git.autistici.org/ai3/build-container/raw/master/common.yml" include: "https://git.autistici.org/pipelines/containers/raw/master/common.yml"
FROM golang:1.20 FROM golang:1.20
WORKDIR /tmp WORKDIR /tmp
COPY run-go-test /usr/bin/run-go-test COPY --chmod=0755 run-go-test /usr/bin/run-go-test
RUN go install github.com/boumenot/gocover-cobertura@latest ; \ RUN go install github.com/boumenot/gocover-cobertura@latest ; \
go install github.com/jstemmer/go-junit-report@latest ; \ go install github.com/jstemmer/go-junit-report@latest
chmod 0755 /usr/bin/run-go-test
Golang test container image
===
This repository builds a container image suitable for running Go
tests. Some useful features:
* generate Gitlab-compatible test and coverage report artifacts
* properly aggregate coverage data for a whole project (across all its
sub-packages)
To use, include *ci.yml* from your project's *.gitlab-ci.yml*. Some
useful variables that can be defined:
* `GO_TEST_PACKAGES` - Debian packages to install before running the
tests
* `GO_TEST_GENERATE` - Set to a non-empty value to run "go generate
./..." before running the tests
* `GO_TEST_ARGS` - Additional arguments for "go test" (tags, etc)
go_test: go_test:
stage: test stage: test
image: registry.git.autistici.org/ai3/docker/test/golang:master image: registry.git.autistici.org/pipelines/images/test/golang:master
script: script:
- if [ -n "$GO_TEST_PACKAGES" ]; then apt-get -q update; env DEBIAN_FRONTEND=noninteractive apt-get -qy install --no-install-recommends $GO_TEST_PACKAGES; fi - if [ -n "$GO_TEST_PACKAGES" ]; then apt-get -q update; env DEBIAN_FRONTEND=noninteractive apt-get -qy install --no-install-recommends $GO_TEST_PACKAGES; fi
- if [ -n "$GO_TEST_GENERATE" ]; then go generate ./... ; fi - if [ -n "$GO_TEST_GENERATE" ]; then go generate ./... ; fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment