summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: e3cd3364af0ef1ccfba2e2672a27dea6d7a387e2 (plain)
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
include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'

cache:
  paths:
    - _ccache/

variables:
  BUNDLE: 'epiphany-git.flatpak'
  MANIFEST_PATH: 'org.gnome.Epiphany.json'
  RUNTIME_REPO: 'https://nightly.gnome.org/gnome-nightly.flatpakrepo'
  FLATPAK_MODULE: 'epiphany'
  APP_ID: 'org.gnome.Epiphany.Devel'
  ESLINT_LOG: "eslint-report.txt"

stages:
  - test

check-code-style:
  stage: .pre
  image: alpine:latest
  interruptible: true
  before_script:
    - apk update && apk add uncrustify bash python3 nodejs nodejs-npm
    - npm install -g eslint
  script:
    - bash data/check-code-style
    - eslint -o eslint-report.txt --no-color embed/web-process-extension/resources/js/ || { cat $ESLINT_LOG; false; }
  artifacts:
    paths:
      - ${ESLINT_LOG}
    when: on_failure

flatpak:
  extends: '.flatpak'
  variables:
    CONFIG_OPTS: '-Dprofile=Devel -Dunit_tests=enabled --werror -Dgsb_api_key=${GSB_API_KEY} -Denable_gsb=true'
  except:
    - master

flatpak master:
  extends: '.flatpak'
  variables:
    CONFIG_OPTS: '-Dtech_preview=true -Dprofile=Devel -Dgsb_api_key=${GSB_API_KEY} -Denable_gsb=true'
  only:
    - master

flatpak scanbuild:
  extends: '.flatpak'
  variables:
    CONFIG_OPTS: '-Dprofile=Devel -Dunit_tests=enabled --werror'
  script:
    - flatpak-builder --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
    - flatpak build flatpak_app meson --prefix=/app ${CONFIG_OPTS} _build
    - flatpak build flatpak_app ninja -C _build scan-build
    - bash -c 'if [[ -n "$(ls -A _build/meson-logs/scanbuild/)" ]]; then echo "Scan build log found, assuming defects exist"; exit 1; fi'
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/scanbuild

nightly:
  extends: '.publish_nightly'
  stage: .post
  dependencies: ['flatpak master']