To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

.gitlab-ci.yml 1.81 KB
Newer Older
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
image: golang:1.12.4-alpine

cache:
  # jobs of each branch always use the same cache
  key: "${CI_COMMIT_REF_SLUG}"
  untracked: true
  paths:
    - .cache

stages:
  - test
  - build

variables:
  # Avoids missing gcc in exec path problem
  CGO_ENABLED: "0"

before_script:
  - apk add --update git make bash
  - 'which ssh-agent || ( apk add --update openssh-client )'
  - eval $(ssh-agent -s)
  ## tr to fix line endings which makes ed25519 keys work  without extra base64 encoding.
  ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
  - bash -c 'printf "%s\n" "$SSH_PRIVATE_KEY_GITLAB"' | tr -d '\r' | ssh-add - > /dev/null
  - mkdir -p ~/.ssh
  - chmod 700 ~/.ssh
  - git config --global url."ssh://git@gitlab.ethz.ch/".insteadOf "https://gitlab.ethz.ch/"
  - git config --global user.email "gitlab-ci@composey.io"
  - git config --global user.name "gitlab-ci composey"
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  - mkdir -p .cache
  - export GOPATH="$CI_PROJECT_DIR/.cache"
  - mkdir -p /home/gotools
  - git clone git@gitlab.ethz.ch:chgerber/gotools.git /home/gotools
  - ln -sf /home/gotools/Makefile $CI_PROJECT_DIR/Makefile
  - ln -sf /home/gotools/tools $CI_PROJECT_DIR/tools
  # youtubedl specific
  - wget "https://yt-dl.org/downloads/latest/youtube-dl" -O "/usr/local/bin/youtube-dl"
  - chmod a+rx "/usr/local/bin/youtube-dl"

unit_tests:
  stage: test
  script:
    - make test

#race_detector:
#  stage: test
#  script:
#    - make race
#
#memory_sanitizer:
#  stage: test
#  script:
#    - make msan

code_coverage:
  stage: test
  script:
    - make coverage

#code_coverage_report:
#  stage: test
#  script:
#    - make coverhtml
#  only:
#    - master

lint_code:
  stage: test
  script:
    - make lint

build:
  stage: build
  script:
    - make