-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
58 lines (53 loc) · 1.52 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
before_script:
- mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache"
cache:
paths:
- .cache
stages:
- test
- build
# - release
format:
stage: test
image: golang:latest
script:
- go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/)
compile:
stage: build
image: golang:latest
script:
- echo "Job ID - $CI_JOB_ID"
- echo COMPILE_JOB_ID=$CI_JOB_ID >> compile.env
- make all
artifacts:
paths:
- bin
reports:
dotenv: compile.env
# release:
# stage: release
# image: registry.gitlab.com/gitlab-org/release-cli:latest
# needs:
# - job: compile
# artifacts: true
# rules:
# - if: $CI_COMMIT_TAG
# script:
# - echo "Running release from $CI_COMMIT_TAG"
# release:
# tag_name: '$CI_COMMIT_TAG'
# description: '$CI_COMMIT_TAG'
# ref: '$CI_COMMIT_TAG'
# assets:
# links:
# - name: Linux x86_64
# url: 'https://gitlab.com/njinx/instx/-/jobs/${COMPILE_JOB_ID}/artifacts/raw/bin/instx-linux-amd64'
# - name: Linux x86
# url: 'https://gitlab.com/njinx/instx/-/jobs/${COMPILE_JOB_ID}/artifacts/raw/bin/instx-linux-386'
# - name: Windows x86_64
# url: 'https://gitlab.com/njinx/instx/-/jobs/${COMPILE_JOB_ID}/artifacts/raw/bin/instx-windows-amd64.exe'
# - name: Windows x86
# url: 'https://gitlab.com/njinx/instx/-/jobs/${COMPILE_JOB_ID}/artifacts/raw/bin/instx-windows-386.exe'