.gitlab-ci.yml 5.87 KB
Newer Older
1 2 3 4
services:
  - docker

stages:
Claudio André's avatar
Claudio André committed
5
- source_check
6
- test
7
- thorough_tests
8
- docs
9 10

.build: &build
11
  when: on_success
12
  artifacts:
13
    name: log
14 15
    when: always
    paths:
16
    - $(pwd)/.cache/jhbuild/build/gjs/*.log
Claudio André's avatar
Claudio André committed
17
    - $(pwd)/.cache/jhbuild/build/gjs/Makefile
18
    - $(pwd)/.cache/jhbuild/build/gjs/configure
Claudio André's avatar
Claudio André committed
19
    - $(pwd)/coverage/
20
    - $(pwd)/cppcheck/
Claudio André's avatar
Claudio André committed
21
    - $(pwd)/cpplint/
22
    - $(pwd)/eslint/
23
    - $(pwd)/tokei/
24 25 26 27
    - $(pwd)/gjs-1.*/_build/sub/test-suite.log
    - $(pwd)/*.log
    - $(pwd)/Makefile
    - $(pwd)/configure
28 29

  script:
30
    # CI starts here. Previous messages are GitLab Runner setup.
Claudio André's avatar
Claudio André committed
31 32 33 34 35 36 37
    - 'echo;
       echo "*********************************************";
       echo "***     JavaScript bindings for GNOME     ***";
       echo "***        Continuous Integration         ***";
       echo "*********************************************";
       echo;
    '
38

39
    # Run static code analysis OR
40
    # Build dependencies and 'make' gjs
41 42 43
    - 'if [[ -n "${CODECHECK}" ]]; then
         $(pwd)/test/test-ci.sh "$CODECHECK";
       else
44
         $(pwd)/test/test-ci.sh GJS;
45
       fi'
46

47
    # Run extra tests
48 49 50 51
    - 'if [[ $BUILD_OPTS == *"--enable-installed-tests"* ]]; then
         $(pwd)/test/test-ci.sh GJS_EXTRA;
       fi'

52 53 54 55 56
    # Run code coverage tests
    - 'if [[ $BUILD_OPTS == *"--enable-code-coverage"* ]]; then
         $(pwd)/test/test-ci.sh GJS_COVERAGE;
       fi'

Claudio André's avatar
Claudio André committed
57 58 59 60 61
    # Run valgrind
    - 'if [[ $BUILD_OPTS == *"--enable-valgrind"* ]]; then
         $(pwd)/test/test-ci.sh VALGRIND;
       fi'

62 63 64 65 66
    - 'echo;
       echo "*********************************************";
       echo "***             See you soon              ***";
       echo "*********************************************";
    '
Claudio André's avatar
Claudio André committed
67 68 69
#############################################
# Able to test despite of any Docker image changes
#############################################
70 71
fedora:
  <<: *build
Claudio André's avatar
Claudio André committed
72 73
  stage: source_check
  image: claudioandre/spidermonkey:job-400.5  # pinned on purpose
74 75 76
  variables:
    CC: gcc
    DEV: devel
77
    TEST: "check"
78
    WARNINGS: "count"
79

Claudio André's avatar
Claudio André committed
80 81 82
#############################################
# Regular tests
#############################################
83 84
ubuntu_gcc:
  <<: *build
Claudio André's avatar
Claudio André committed
85
  stage: test
86
  image: claudioandre/spidermonkey:ubuntu.dev.gcc
87 88
  variables:
    CC: gcc
89
    DEV: devel
90
    TEST: "distcheck"
91 92
  only:
    - master@GNOME/gjs
93

Claudio André's avatar
Claudio André committed
94 95
ubuntu_clang:
  <<: *build
Claudio André's avatar
Claudio André committed
96
  stage: test
97
  image: claudioandre/spidermonkey:ubuntu.dev.gcc
Claudio André's avatar
Claudio André committed
98 99
  variables:
    CC: clang
100
    DEV: devel
101
    TEST: "distcheck"
Claudio André's avatar
Claudio André committed
102 103 104
  only:
    - master@GNOME/gjs

105
fedora_clang:
106
  <<: *build
Claudio André's avatar
Claudio André committed
107
  stage: test
108
  image: claudioandre/spidermonkey:new-342.4  # temporarily pinned to old tag
109
  variables:
110
    CC: clang
111
    DEV: devel
112
    TEST: "distcheck"
113

114 115 116
no_profiler:
  <<: *build
  stage: thorough_tests
117
  image: claudioandre/spidermonkey:job-400.5  # temporarily pinned to old tag
118 119 120 121 122 123
  variables:
    CC: gcc
    DEV: devel
    TEST: "check"
    BUILD_OPTS: "--disable-profiler"

124 125 126 127 128 129 130 131 132
installed_tests:
  <<: *build
  stage: thorough_tests
  image: claudioandre/spidermonkey:ubuntu.dev.gcc
  variables:
    CC: clang
    DEV: devel
    BUILD_OPTS: "--enable-installed-tests --prefix=/usr"

133 134
coverage:
  <<: *build
135
  stage: thorough_tests
136 137 138
  image: claudioandre/spidermonkey:fedora.27.gcc
  variables:
    CC: gcc
139
    BUILD_OPTS: "--enable-code-coverage"
Claudio André's avatar
Claudio André committed
140
    coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
141 142
  except:
    - /^wip\/.*/
Claudio André's avatar
Claudio André committed
143

Claudio André's avatar
Claudio André committed
144 145 146
sanitizer_gcc:
  <<: *build
  stage: thorough_tests
147
  image: claudioandre/spidermonkey:job-400.5  # temporarily pinned to old tag
Claudio André's avatar
Claudio André committed
148 149 150
  variables:
    CC: gcc
    DEV: devel
151
    TEST: "check"
Claudio André's avatar
Claudio André committed
152 153 154 155 156 157 158 159 160
    BUILD_OPTS: "--enable-asan --enable-ubsan"

sanitizer_clang:
  <<: *build
  stage: thorough_tests
  image: claudioandre/spidermonkey:new-342.4  # temporarily pinned to old tag
  variables:
    CC: clang
    DEV: devel
161
    TEST: "check"
Claudio André's avatar
Claudio André committed
162
    BUILD_OPTS: "--enable-asan --enable-ubsan"
163 164
  only:
    - master@GNOME/gjs
Claudio André's avatar
Claudio André committed
165

166 167 168 169 170 171 172 173 174 175 176 177
codequality:
  stage: thorough_tests
  image: docker:latest
  variables:
    DOCKER_DRIVER: overlay
  services:
    - docker:dind
  script:
    - docker pull codeclimate/codeclimate
    - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze -f json > codeclimate.json
  artifacts:
    paths: [codeclimate.json]
178 179
  only:
    - master@GNOME/gjs
180

Claudio André's avatar
Claudio André committed
181 182 183
#############################################
# Static Analyzers
#############################################
184
cppcheck:
185
  <<: *build
Claudio André's avatar
Claudio André committed
186
  stage: source_check
187
  image: claudioandre/spidermonkey:fedora.static.analysis
188 189 190
  variables:
    CODECHECK: "CPPCHECK"

Claudio André's avatar
Claudio André committed
191 192
cpplint:
  <<: *build
Claudio André's avatar
Claudio André committed
193
  stage: source_check
194
  image: claudioandre/spidermonkey:fedora.static.analysis
Claudio André's avatar
Claudio André committed
195 196 197
  variables:
    CODECHECK: "CPPLINT"

198 199
eslint:
  <<: *build
Claudio André's avatar
Claudio André committed
200
  stage: source_check
201
  image: claudioandre/spidermonkey:fedora.static.analysis
202 203 204
  variables:
    CODECHECK: "ESLINT"

205 206
code_statistics:
  <<: *build
Claudio André's avatar
Claudio André committed
207
  stage: source_check
208
  image: claudioandre/spidermonkey:fedora.static.analysis
209 210
  variables:
    CODECHECK: "TOKEI"
211 212
  only:
    - master@GNOME/gjs
213

Claudio André's avatar
Claudio André committed
214 215 216
#############################################
# Publish the Code Coverage Report
#############################################
217
pages:
218
  stage: docs
219
  dependencies:
220
    - coverage
221 222 223 224 225 226 227
  script:
    - mv $(pwd)/coverage/ public/
  artifacts:
    paths:
      - public
  only:
    - master@GNOME/gjs
228 229 230 231 232 233 234

#############################################
# Optional / Manual CI tests
#############################################
valgrind:
  <<: *build
  stage: thorough_tests
235
  image: claudioandre/spidermonkey:job-400.5  # temporarily pinned to old tag
236 237 238 239 240 241 242 243 244 245
  variables:
    CC: gcc
    DEV: devel
    BUILD_OPTS: "--enable-valgrind --disable-valgrind-helgrind --prefix=/usr"
  allow_failure: true
  when: manual

no_graphics:
  <<: *build
  stage: thorough_tests
246
  image: claudioandre/spidermonkey:job-400.5  # temporarily pinned to old tag
247 248 249 250 251 252
  variables:
    CC: gcc
    DEV: devel
    TEST: "check"
    BUILD_OPTS: "--without-cairo --without-gtk"
  when: manual