-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
49 lines (41 loc) · 993 Bytes
/
.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
image: docker
default:
tags:
- be-runner
stages:
# - init
- test
- build
# - deploy
# init:
# stage: init
# script:
# - sudo docker-compose up -d --build
test:
stage: test
only:
- main
script:
- CGO_ENABLED=0 go test ./... -coverprofile=coverage-report.out
- go tool cover -html=coverage-report.out -o coverage-report.html
- go tool cover -func=coverage-report.out
only:
- main
artifacts:
paths:
- coverage-report.html
expire_in: 1 hour
coverage: "/\\(statements\\)\\s+\\d+.?\\d+%/"
build-job:
stage: build
when: on_success
only:
- main
image: docker:stable
services:
- name: docker:dind
command: ["--tls=false"]
script:
- docker login gitlab.informatika.org:4567 -u access-token-sm-be -p $CI_TOKEN
- docker build -t gitlab.informatika.org:4567/if3250_2024_k03_02_sm-02/sm-be .
- docker push gitlab.informatika.org:4567/if3250_2024_k03_02_sm-02/sm-be