.gitlab-ci.yml 20.9 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
- manual
9
- deploy
10

11 12 13 14 15 16 17 18 19 20 21 22 23
.CI_header: &CI_header  'echo;
       echo "*********************************************";
       echo "***     JavaScript bindings for GNOME     ***";
       echo "***        Continuous Integration         ***";
       echo "*********************************************";
       echo;
    '
.CI_footer: &CI_footer 'echo;
       echo "*********************************************";
       echo "***             See you soon              ***";
       echo "*********************************************";
    '

24
.JHBuild files: &JHB_files  [.cache/jhbuild/build/gjs/*.log, .cache/jhbuild/build/gjs/Makefile, .cache/jhbuild/build/gjs/configure]
25
.Coverage files: &cov_files [configure, Makefile, analysis/, ./*.log, ./*.trs, ./installed-tests/scripts/*.log, ./installed-tests/scripts/*.trs, coverage/]
26
.Regular files: &reg_files  [configure, Makefile, analysis/, ./*.log, ./*.trs, ./installed-tests/scripts/*.log, ./installed-tests/scripts/*.trs]
27 28 29
.Flatpak files: &pak_files  [./*.flatpak]

.jhbuild: &jhbuild
30
  artifacts:
31 32
    name: log_jhbuild
    when: always
33
    paths: *JHB_files
34 35 36 37

.coverage: &coverage
  artifacts:
    name: log_coverage
38
    when: always
39 40 41 42 43 44
    paths: *cov_files

.package: &package
  artifacts:
    name: log_package
    paths: *pak_files
45

46
# Regular build
47 48 49 50 51
.build: &build
  when: on_success
  artifacts:
    name: log
    when: always
52
    paths: *reg_files
53 54

  script:
55 56
    # CI starts here. Previous messages are from GitLab Runner setup.
    - *CI_header
57

58 59 60
    # GitLab is keeping some files between jobs. Remove them.
    - rm -rf configure Makefile *.log analysis

61 62
    # Run static code analysis	OR
    # Build GJS
63 64 65
    - 'if [[ -n "${CODECHECK}" ]]; then
         $(pwd)/test/test-ci.sh "$CODECHECK";
       else
66
         $(pwd)/test/test-ci.sh GJS;
67 68
       fi
    '
69

70
    # Run installed extra tests
71 72
    - 'if [[ $BUILD_OPTS == *"--enable-installed-tests"* ]]; then
         $(pwd)/test/test-ci.sh GJS_EXTRA;
73 74
       fi
    '
75

76 77 78
    # Run code coverage tests
    - 'if [[ $BUILD_OPTS == *"--enable-code-coverage"* ]]; then
         $(pwd)/test/test-ci.sh GJS_COVERAGE;
79 80
       fi
    '
81

Claudio André's avatar
Claudio André committed
82 83 84
    # Run valgrind
    - 'if [[ $BUILD_OPTS == *"--enable-valgrind"* ]]; then
         $(pwd)/test/test-ci.sh VALGRIND;
85 86
       fi
    '
Claudio André's avatar
Claudio André committed
87

88 89 90 91 92 93
    # Run the script tests again (to assure they are working)
    - 'if [[ -n "${SCRIPTCHECK}" ]]; then
         $(pwd)/test/test-ci.sh SH_CHECKS;
       fi
    '

94 95
    # Done
    - *CI_footer
96

97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
# Cross (multi architecture) build
.qemu: &multiarch
  artifacts:
    name: log
    when: always
    paths: *reg_files

  image: docker:latest
  services:
    - docker:dind

  script:
    # CI starts here. Previous messages are from GitLab Runner setup.
    - *CI_header

    # Register QEMU archs
    - docker run --rm --privileged multiarch/qemu-user-static:register --reset

    # Run the multiarch test job using QEMU
    - 'docker run -v $(pwd):/cwd
          -e TEST=check -e TASK_ID=$TASK_ID $IMAGE
          bash -e -c "cd /cwd && test/test-ci.sh GJS"
    '

    # Done
    - *CI_footer

Claudio André's avatar
Claudio André committed
124
#############################################
125
#               Regular tests               #
Claudio André's avatar
Claudio André committed
126
#############################################
Claudio André's avatar
Claudio André committed
127 128
# Test despite any changes in the Docker image
# SpiderMonkey has been configured with --enable-debug
129 130
fedora:
  <<: *build
Claudio André's avatar
Claudio André committed
131
  stage: source_check
132
  image: registry.gitlab.gnome.org/gnome/gjs:job-142243_SM60-debug-gcc.fedora-dev  # pinned on purpose
133
  variables:
Claudio André's avatar
Claudio André committed
134
    TASK_ID: "fedora-x86_64-gcc-debug-default-check"
135
    TEST: "check"
136
    WARNINGS: "count"
137 138
  except:
    - schedules
139

Claudio André's avatar
Claudio André committed
140
sanitizer_gcc:
141
  <<: *build
Claudio André's avatar
Claudio André committed
142
  stage: test
143
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
144
  variables:
Claudio André's avatar
Claudio André committed
145
    TASK_ID: "fedora-x86_64-gcc-default-ubsan_asan-check"
Claudio André's avatar
Claudio André committed
146
    BUILD_OPTS: "--enable-asan --enable-ubsan"
Claudio André's avatar
Claudio André committed
147
    TEST: "check"
148 149
  except:
    - schedules
150

151 152 153 154
# There are a lot of debug log statements that are ifdef'd out in normal usage.
# These sometimes get invalid expressions in them, leading to annoyance the
# next time you try to use debug logging.
with_logging:
155
  <<: *build
Claudio André's avatar
Claudio André committed
156
  stage: test
157
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
158
  variables:
159
    TASK_ID: "ubuntu-x86_64-clang-default-logging-check"
Claudio André's avatar
Claudio André committed
160
    CC: clang
161
    BUILD_OPTS: "CPPFLAGS='-DGJS_VERBOSE_ENABLE_PROPS=1 -DGJS_VERBOSE_ENABLE_MARSHAL=1 -DGJS_VERBOSE_ENABLE_LIFECYCLE=1 -DGJS_VERBOSE_ENABLE_GI_USAGE=1 -DGJS_VERBOSE_ENABLE_GCLOSURE=1 -DGJS_VERBOSE_ENABLE_GSIGNAL=1'"
Claudio André's avatar
Claudio André committed
162
    TEST: "check"
163
    SCRIPTCHECK: "yes"
164
    ENABLE_GTK: "yes"
165 166
  except:
    - schedules
167

Philip Chimento's avatar
Philip Chimento committed
168 169 170 171 172 173 174 175 176 177 178
with_systemtap:
  <<: *build
  stage: test
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
  variables:
    TASK_ID: "fedora-x86_64-gcc-default-systemtap-check"
    TEST: "check"
    BUILD_OPTS: "--enable-systemtap"
  except:
    - schedules

Claudio André's avatar
Claudio André committed
179
no_graphics:
Claudio André's avatar
Claudio André committed
180
  <<: *build
181
  stage: test
182
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
Claudio André's avatar
Claudio André committed
183
  variables:
Claudio André's avatar
Claudio André committed
184 185 186
    TASK_ID: "fedora-x86_64-gcc-default-without_gtk-check"
    TEST: "check"
    BUILD_OPTS: "--without-cairo --without-gtk"
187
    SCRIPTCHECK: "yes"
188 189
  except:
    - schedules
Claudio André's avatar
Claudio André committed
190

Claudio André's avatar
Claudio André committed
191
no_profiler:
192
  <<: *build
193
  stage: test
194
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
Claudio André's avatar
Claudio André committed
195
  variables:
Claudio André's avatar
Claudio André committed
196
    TASK_ID: "fedora-x86_64-gcc-default-disable_profiler-check"
197
    TEST: "check"
Claudio André's avatar
Claudio André committed
198
    BUILD_OPTS: "--disable-profiler"
199 200
  except:
    - schedules
201

202 203 204
no_readline:
  <<: *build
  stage: test
205
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
206 207 208 209 210 211 212
  variables:
    TASK_ID: "fedora-x86_64-gcc-default-disable_readline-check"
    TEST: "check"
    BUILD_OPTS: "--disable-readline"
  except:
    - schedules

213 214 215 216 217 218
# Generates
# The Code Coverage Report
coverage-automatic:
  <<: *build
  <<: *coverage
  stage: source_check
219
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
220 221
  variables:
    TASK_ID: "coverage"
222
    BUILD_OPTS: "--enable-code-coverage"
223 224 225 226 227 228 229 230 231 232
    coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
  except:
    - schedules
  only:
    refs:
      - master@GNOME/gjs

# Publishes
# The reports (coverage and code statistics)
pages:
233
  stage: deploy
234 235 236 237 238 239 240 241 242 243 244 245
  dependencies:
    - coverage-automatic
    - code_statistics
  script:
    - mv $(pwd)/coverage/ public/ || true
    - mv $(pwd)/analysis/report.txt public/ || true
  artifacts:
    paths:
      - public
  only:
    refs:
      - master@GNOME/gjs
246 247 248
  except:
    variables:
      - $CRON_TASK == "BUILD_CI_IMAGES"
249

Claudio André's avatar
Claudio André committed
250
#############################################
251
#              Static Analyzers             #
Claudio André's avatar
Claudio André committed
252
#############################################
253
cppcheck:
254
  <<: *build
Claudio André's avatar
Claudio André committed
255
  stage: source_check
256
  image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis
257
  variables:
Claudio André's avatar
Claudio André committed
258
    TASK_ID: "cppcheck"
259
    CODECHECK: "CPPCHECK"
260 261
  except:
    - schedules
262
    - tags
263

Claudio André's avatar
Claudio André committed
264 265
cpplint:
  <<: *build
Claudio André's avatar
Claudio André committed
266
  stage: source_check
267
  image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis
Claudio André's avatar
Claudio André committed
268
  variables:
Claudio André's avatar
Claudio André committed
269
    TASK_ID: "cpplint"
Claudio André's avatar
Claudio André committed
270
    CODECHECK: "CPPLINT"
271 272
  except:
    - schedules
273
    - tags
Claudio André's avatar
Claudio André committed
274

275 276
eslint:
  <<: *build
Claudio André's avatar
Claudio André committed
277
  stage: source_check
278
  image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis
279
  variables:
Claudio André's avatar
Claudio André committed
280
    TASK_ID: "eslint"
281
    CODECHECK: "ESLINT"
282 283
  except:
    - schedules
284
    - tags
285

Claudio André's avatar
Claudio André committed
286
#############################################
287
#         Daily jobs / Frequent jobs        #
Claudio André's avatar
Claudio André committed
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
#############################################
codequality:
  stage: source_check
  image: docker:latest
  variables:
    TASK_ID: "codequality"
    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]
  only:
    refs:
      - master@GNOME/gjs
    variables:
      - $CRON_FREQUENCY == "Daily"

308 309
code_statistics:
  <<: *build
Claudio André's avatar
Claudio André committed
310
  stage: source_check
311
  image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis
312
  variables:
Claudio André's avatar
Claudio André committed
313
    TASK_ID: "code_statistics"
314
    CODECHECK: "TOKEI"
315
  only:
Claudio André's avatar
Claudio André committed
316 317
    variables:
      - $CRON_FREQUENCY == "Daily"
318

Claudio André's avatar
Claudio André committed
319
sanitizer_clang:
320 321
  <<: *build
  stage: thorough_tests
322
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
323
  variables:
324
    TASK_ID: "ubuntu-x86_64-clang_ubsan_asan-default-default-check"
Claudio André's avatar
Claudio André committed
325
    CC: clang
326
    BUILD_OPTS: "--enable-asan --enable-ubsan"
327
    TEST: "check"
Claudio André's avatar
Claudio André committed
328 329 330
  only:
    variables:
      - $CRON_FREQUENCY == "Daily"
331

Claudio André's avatar
Claudio André committed
332
fedora_gcc:
333 334
  <<: *build
  stage: thorough_tests
335
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
336
  variables:
Claudio André's avatar
Claudio André committed
337 338 339 340 341
    TASK_ID: "fedora-x86_64-gcc-default-default-distcheck"
    TEST: "distcheck"
  only:
    variables:
      - $CRON_FREQUENCY == "Daily"
342 343 344 345

installed_tests:
  <<: *build
  stage: thorough_tests
346
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
Claudio André's avatar
Claudio André committed
347 348 349 350 351 352 353 354
  variables:
    TASK_ID: "fedora-x86_64-gcc-default-default-installed_tests"
    BUILD_OPTS: "--enable-installed-tests --prefix=/usr"
  only:
    variables:
      - $CRON_FREQUENCY == "Daily"

#############################################
355
#       Weekly jobs / Non-Frequent jobs     #
Claudio André's avatar
Claudio André committed
356 357 358 359
#############################################
ubuntu_gcc:
  <<: *build
  stage: source_check
360
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
Claudio André's avatar
Claudio André committed
361 362 363 364 365 366 367 368 369 370
  variables:
    TASK_ID: "ubuntu-x86_64-gcc-default-default-distcheck"
    TEST: "distcheck"
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"

ubuntu_clang:
  <<: *build
  stage: source_check
371
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
372
  variables:
Claudio André's avatar
Claudio André committed
373
    TASK_ID: "ubuntu-x86_64-clang-default-default-distcheck"
374
    CC: clang
Claudio André's avatar
Claudio André committed
375 376 377 378
    TEST: "distcheck"
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
379

380 381
lts:
  <<: *build
382
  <<: *jhbuild
383
  stage: thorough_tests
384
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-lts
385
  variables:
Claudio André's avatar
Claudio André committed
386
    TASK_ID: "ubuntu_lts-x86_64-gcc-default-default-check"
387
    DEV: jhbuild
388
    TEST: "check"
Claudio André's avatar
Claudio André committed
389 390 391 392 393 394 395
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"

valgrind:
  <<: *build
  stage: thorough_tests
396
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
Claudio André's avatar
Claudio André committed
397 398 399 400 401 402 403 404
  variables:
    TASK_ID: "fedora-x86_64-gcc-default-default-valgrind_check"
    BUILD_OPTS: "--enable-valgrind --disable-valgrind-helgrind --prefix=/usr"
    TEST: "check"
  allow_failure: true
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
405 406

#############################################
407
#         Flatpak packaging (weekly)        #
408
#############################################
409
flatpak:
410
  <<: *build
411
  <<: *package
412
  stage: deploy
413 414
  image: registry.gitlab.gnome.org/gnome/gnome-nightly-oci/nightly:master
  variables:
415
    TASK_ID: "flatpak packaging"
416 417 418 419 420 421 422 423 424
    CODECHECK: "FLATPAK"
    APPID: "org.gnome.GjsDevel"
    BUNDLE: "org.gnome.GjsDevel.flatpak"
    MANIFEST_PATH: "org.gnome.GjsDevel.json"
    RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"

  environment:
    name: review/$CI_COMMIT_REF_NAME
    url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
Claudio André's avatar
Claudio André committed
425 426 427
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
Claudio André's avatar
Claudio André committed
428 429

#############################################
430
#       SpiderMonkey GC Tests (weekly)      #
Claudio André's avatar
Claudio André committed
431 432 433 434
#############################################
zeal_2:
  <<: *build
  stage: thorough_tests
435
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-debug-gcc.fedora-dev
Claudio André's avatar
Claudio André committed
436
  variables:
Claudio André's avatar
Claudio André committed
437
    TASK_ID: "fedora-x86_64-gcc-debug-default-check_zeal2"
Claudio André's avatar
Claudio André committed
438 439
    TEST: "check"
    JS_GC_ZEAL: 2
Claudio André's avatar
Claudio André committed
440 441 442
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
Claudio André's avatar
Claudio André committed
443 444 445 446

zeal_4:
  <<: *build
  stage: thorough_tests
447
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-debug-gcc.fedora-dev
Claudio André's avatar
Claudio André committed
448
  variables:
Claudio André's avatar
Claudio André committed
449
    TASK_ID: "fedora-x86_64-gcc-debug-default-check_zeal4"
Claudio André's avatar
Claudio André committed
450 451
    TEST: "check"
    JS_GC_ZEAL: 4
Claudio André's avatar
Claudio André committed
452 453 454
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
Claudio André's avatar
Claudio André committed
455 456 457 458

zeal_11:
  <<: *build
  stage: thorough_tests
459
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-debug-gcc.fedora-dev
Claudio André's avatar
Claudio André committed
460
  variables:
Claudio André's avatar
Claudio André committed
461
    TASK_ID: "fedora-x86_64-gcc-debug-default-check_zeal11"
Claudio André's avatar
Claudio André committed
462 463
    TEST: "check"
    JS_GC_ZEAL: 11
Claudio André's avatar
Claudio André committed
464 465 466
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
467 468

#############################################
469
#          Multiarch Tests (weekly)         #
470 471 472 473 474
#############################################
armv8:
  <<: *multiarch
  stage: thorough_tests
  variables:
Claudio André's avatar
Claudio André committed
475
    TASK_ID: "fedora-armv8-gcc-default-default-check"
476
    DOCKER_DRIVER: overlay
477
    IMAGE: "registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev.aarch64"
478 479 480
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
481 482 483 484 485

ppc64le:
  <<: *multiarch
  stage: thorough_tests
  variables:
Claudio André's avatar
Claudio André committed
486
    TASK_ID: "fedora-ppc64le-gcc-default-default-check"
487
    DOCKER_DRIVER: overlay
488
    IMAGE: "registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev.ppc64le"
489 490 491
  only:
    variables:
      - $CRON_FREQUENCY == "Weekly"
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516

#############################################
#                Manual Jobs                #
#############################################
# Planned as daily
codequality:
  stage: manual
  image: docker:latest
  variables:
    TASK_ID: "codequality"
    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]
  when: manual
  except:
    - schedules

code_statistics:
  <<: *build
  stage: manual
517
  image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis
518 519 520 521 522 523 524 525 526 527 528
  variables:
    TASK_ID: "code_statistics"
    CODECHECK: "TOKEI"
  when: manual
  except:
    - schedules

coverage:
  <<: *build
  <<: *coverage
  stage: manual
529
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
530 531 532 533 534 535 536 537 538 539 540
  variables:
    TASK_ID: "coverage"
    BUILD_OPTS: "--enable-code-coverage"
    coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
  when: manual
  except:
    - schedules

sanitizer_clang:
  <<: *build
  stage: manual
541
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
542
  variables:
543
    TASK_ID: "ubuntu-x86_64-clang_ubsan_asan-default-default-check"
544
    CC: clang
545
    BUILD_OPTS: "--enable-asan --enable-ubsan"
546 547 548 549 550 551 552 553
    TEST: "check"
  when: manual
  except:
    - schedules

fedora_gcc:
  <<: *build
  stage: manual
554
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
555 556 557 558 559 560 561 562 563 564
  variables:
    TASK_ID: "fedora-x86_64-gcc-default-default-distcheck"
    TEST: "distcheck"
  when: manual
  except:
    - schedules

installed_tests:
  <<: *build
  stage: manual
565
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
566 567 568 569 570 571 572 573 574 575 576
  variables:
    TASK_ID: "fedora-x86_64-gcc-default-default-installed_tests"
    BUILD_OPTS: "--enable-installed-tests --prefix=/usr"
  when: manual
  except:
    - schedules

# Planned as weekly
ubuntu_gcc:
  <<: *build
  stage: manual
577
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
578 579 580 581 582 583 584 585 586 587
  variables:
    TASK_ID: "ubuntu-x86_64-gcc-default-default-distcheck"
    TEST: "distcheck"
  when: manual
  except:
    - schedules

ubuntu_clang:
  <<: *build
  stage: manual
588
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-dev
589 590 591 592 593 594 595 596 597 598 599 600
  variables:
    TASK_ID: "ubuntu-x86_64-clang-default-default-distcheck"
    CC: clang
    TEST: "distcheck"
  when: manual
  except:
    - schedules

lts:
  <<: *build
  <<: *jhbuild
  stage: manual
601
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.ubuntu-lts
602 603 604 605 606 607 608 609 610 611 612
  variables:
    TASK_ID: "ubuntu_lts-x86_64-gcc-default-default-check"
    DEV: jhbuild
    TEST: "check"
  when: manual
  except:
    - schedules

valgrind:
  <<: *build
  stage: manual
613
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev
614 615 616 617 618 619 620 621 622 623
  variables:
    TASK_ID: "fedora-x86_64-gcc-default-default-valgrind_check"
    BUILD_OPTS: "--enable-valgrind --disable-valgrind-helgrind --prefix=/usr"
    TEST: "check"
  allow_failure: true
  when: manual
  except:
    - schedules

# Flatpak packaging (weekly)
624
flatpak:
625 626 627 628 629
  <<: *build
  <<: *package
  stage: manual
  image: registry.gitlab.gnome.org/gnome/gnome-nightly-oci/nightly:master
  variables:
630
    TASK_ID: "flatpak packaging"
631 632
    CODECHECK: "FLATPAK"
    BUNDLE: "org.gnome.GjsDevel.flatpak"
633
    MANIFEST: org.gnome.GjsDevel.json
634 635 636 637 638 639 640 641 642 643 644 645 646
    RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"

  environment:
    name: review/$CI_COMMIT_REF_NAME
    url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
  when: manual
  except:
    - schedules

# SpiderMonkey GC Tests (weekly)
zeal_2:
  <<: *build
  stage: manual
647
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-debug-gcc.fedora-dev
648 649 650 651 652 653 654 655 656 657 658
  variables:
    TASK_ID: "fedora-x86_64-gcc-debug-default-check_zeal2"
    TEST: "check"
    JS_GC_ZEAL: 2
  when: manual
  except:
    - schedules

zeal_4:
  <<: *build
  stage: manual
659
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-debug-gcc.fedora-dev
660 661 662 663 664 665 666 667 668 669 670
  variables:
    TASK_ID: "fedora-x86_64-gcc-debug-default-check_zeal4"
    TEST: "check"
    JS_GC_ZEAL: 4
  when: manual
  except:
    - schedules

zeal_11:
  <<: *build
  stage: manual
671
  image: registry.gitlab.gnome.org/gnome/gjs:SM60-debug-gcc.fedora-dev
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686
  variables:
    TASK_ID: "fedora-x86_64-gcc-debug-default-check_zeal11"
    TEST: "check"
    JS_GC_ZEAL: 11
  when: manual
  except:
    - schedules

# Multiarch Tests (weekly)
armv8:
  <<: *multiarch
  stage: manual
  variables:
    TASK_ID: "fedora-armv8-gcc-default-default-check"
    DOCKER_DRIVER: overlay
687
    IMAGE: "registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev.aarch64"
688 689 690 691 692 693 694 695 696 697
  when: manual
  except:
    - schedules

ppc64le:
  <<: *multiarch
  stage: manual
  variables:
    TASK_ID: "fedora-ppc64le-gcc-default-default-check"
    DOCKER_DRIVER: overlay
698
    IMAGE: "registry.gitlab.gnome.org/gnome/gjs:SM60-gcc.fedora-dev.ppc64le"
699 700 701
  when: manual
  except:
    - schedules
702 703 704 705 706 707

#############################################
#          Create CI Docker Images          #
#############################################
.Docker image template: &create_docker_image
  image: docker:latest
708
  stage: deploy
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
  services:
    - docker:dind
  only:
    variables:
      - $CRON_TASK == "BUILD_CI_IMAGES"

  script:
    # CI starts here. Previous messages are from GitLab Runner setup.
    - *CI_header

    # Skip the build (if requested)
    - |
      if [[ -z "${CI_COMMIT_MESSAGE##*[skip images]*}" && -z "${CI_COMMIT_MESSAGE##*$NAME*}" ]]; then
        echo "== Nothing to do =="
        exit 0
      fi

726 727 728 729 730 731 732
    # Get multiarch stuff
    - |
      if [[ -n "${TARGET_ARCH}" ]]; then
        docker run --rm --privileged multiarch/qemu-user-static:register --reset
        wget https://github.com/multiarch/qemu-user-static/releases/download/v2.12.0/x86_64_qemu-${TARGET_ARCH}-static.tar.gz
      fi

733 734 735
    # Build using the Dockerfile
    - |
      if [[ -n "${DOCKERFILE}" ]]; then
736
        docker build -f "$DOCKERFILE" -t "$CI_REGISTRY_IMAGE:$NAME" .
737 738
      fi

739 740 741 742 743 744 745 746 747
    # Where the real magic happens
    - |
      if [[ -n "${IMAGE}" ]]; then
        docker run --name $NAME -v $(pwd):/on-host \
          -e BASE=$BASE -e OS=$IMAGE -e BUILD_OPTS=$BUILD_OPTS -e DEV=$DEV -e CC=gcc -e STATIC=$STATIC $IMAGE \
          bash -e -c "cd /on-host && test/ci-images.sh BUILD_MOZ"
        docker commit $NAME "$CI_REGISTRY_IMAGE:$NAME"
      fi

748
    # Prepare to publish
749
    - docker tag "$CI_REGISTRY_IMAGE:$NAME" "$CI_REGISTRY_IMAGE:job-"$CI_JOB_ID"_$NAME"
750 751 752
    - docker images
    - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}

753 754 755 756 757
    # Publish (if running on a schedule)
    - |
      if [[ "${CI_PIPELINE_SOURCE}" == "schedule" ]]; then
        docker push "$CI_REGISTRY_IMAGE"
      fi
758 759 760 761 762 763 764 765 766 767 768

    # Done
    - *CI_footer

fedora.static-analysis:
  <<: *create_docker_image
  variables:
    BASE: "fedora"
    DOCKER_DRIVER: overlay
    DOCKERFILE: "test/extra/Dockerfile.fedora.static-analysis"
    NAME: "fedora.static-analysis"
769

770
SM60-gcc.fedora-dev:
771 772 773 774 775 776
  <<: *create_docker_image
  variables:
    BASE: "fedora"
    DEV: "devel"
    DOCKER_DRIVER: overlay
    IMAGE: "fedora:rawhide"
777
    NAME: "SM60-gcc.fedora-dev"
778

779
SM60-debug-gcc.fedora-dev:
780 781 782 783 784 785 786
  <<: *create_docker_image
  variables:
    BASE: "fedora"
    BUILD_OPTS: "--enable-debug"
    DEV: "devel"
    DOCKER_DRIVER: overlay
    IMAGE: "fedora:rawhide"
787
    NAME: "SM60-debug-gcc.fedora-dev"
788

789
SM60-gcc.fedora-dev.aarch64:
790 791 792 793 794 795
  <<: *create_docker_image
  variables:
    BASE: "fedora"
    DEV: "devel"
    DOCKER_DRIVER: overlay
    DOCKERFILE: "test/extra/Dockerfile.arm64v8.fedora.29"
796 797
    IMAGE: "${CI_REGISTRY_IMAGE}:SM60-gcc.fedora-dev.aarch64"
    NAME: "SM60-gcc.fedora-dev.aarch64"
798 799 800
    STATIC: "qemu"
    TARGET_ARCH: "aarch64"

801
SM60-gcc.fedora-dev.ppc64le:
802 803 804 805 806 807
  <<: *create_docker_image
  variables:
    BASE: "fedora"
    DEV: "devel"
    DOCKER_DRIVER: overlay
    DOCKERFILE: "test/extra/Dockerfile.ppc64le.fedora.29"
808 809
    IMAGE: "${CI_REGISTRY_IMAGE}:SM60-gcc.fedora-dev.ppc64le"
    NAME: "SM60-gcc.fedora-dev.ppc64le"
810 811 812
    STATIC: "qemu"
    TARGET_ARCH: "ppc64le"

813
SM60-gcc.ubuntu-lts:
814 815 816 817 818
  <<: *create_docker_image
  variables:
    BASE: "debian"
    DOCKER_DRIVER: overlay
    IMAGE: "ubuntu:18.04"
819
    NAME: "SM60-gcc.ubuntu-lts"
820

821
SM60-gcc.ubuntu-dev:
822 823 824 825 826 827
  <<: *create_docker_image
  variables:
    BASE: "debian"
    DEV: "devel"
    DOCKER_DRIVER: overlay
    IMAGE: "ubuntu:devel"
828
    NAME: "SM60-gcc.ubuntu-dev"