-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
66 lines (47 loc) · 1.13 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
image: golang:1.15
stages:
- build
- test
# do not forget to set project variables
include:
- template: SAST.gitlab-ci.yml # GITLAB_FEATURES = "sast"
#- template: Code-Quality.gitlab-ci.yml # GITLAB_FEATURES = "code_quality"
#- template: Dependency-Scanning.gitlab-ci.yml # GITLAB_FEATURES = "dependency_scanning"
#- template: License-Scanning.gitlab-ci.yml # GITLAB_FEATURES = "license_scanning"
variables:
SAST_DISABLE_DIND: "true"
SAST_GOSEC_LEVEL: 0
.build_command: &build_command
- go build ./...
.test_command: &test_command
- go test ./...
build-master:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
script:
- *build_command
test-master:
stage: test
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: on_success
script:
- *test_command
build-not-master:
stage: build
rules:
- if: $CI_COMMIT_BRANCH != "master"
when: always
allow_failure: true
script:
- *build_command
test-not-master:
stage: test
rules:
- if: $CI_COMMIT_BRANCH != "master"
when: on_success
allow_failure: true
script:
- *test_command