-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
80 lines (69 loc) · 1.5 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
include:
- 'https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/-/raw/master/ci-include/github-status-sync.yml'
variables:
UPSTREAM_PROJECT: oidc-mytoken/client
image: golang:1.22
stages:
- build
- test
- lint
- release
default:
tags:
- linux
cache:
paths:
- .cache
before_script:
- mkdir -p .cache
- export GOPATH=${CI_PROJECT_DIR}/.cache
test:
stage: test
script:
- go test -v ./...
test_race:
stage: test
script:
- go test -race -v ./...
staticcheck:
image: golang:1.22
stage: lint
before_script:
- go install honnef.co/go/tools/cmd/staticcheck@latest
script:
- staticcheck ./...
vet:
stage: lint
script:
- go vet ./...
build:
stage: build
script:
- go build github.com/oidc-mytoken/client/cmd/mytoken
prerelease:
stage: release
image:
name: goreleaser/goreleaser
entrypoint: [""]
services:
- docker:dind
only:
refs:
- tags
- prerel
tags:
- linux
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
REPO_HOST: repo.data.kit.edu
REPO_USER: cicd
DOCKER_REGISTRY: https://index.docker.io/v1/
before_script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin "$DOCKER_REGISTRY"
script:
- if [ -z "$CI_COMMIT_TAG" ]; then .gitlab-ci-scripts/set-prerel-version.sh; fi;
- .gitlab-ci-scripts/goreleaser.sh
- .gitlab-ci-scripts/upload.sh
after_script:
- curl -d "repo=github.com/oidc-mytoken/client" https://goreportcard.com/checks