summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 9d0dac9feee2d5a5e280ea586d5295eccb026c52 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
stages:
  - build
  - analysis
  - docs
  - deploy

# Common variables
variables:
  CCACHE_DIR: _ccache
  COMMON_MESON_FLAGS: "-Dwerror=true -Dglib:werror=false"
  LOADERS_FLAGS: "-Dpng=enabled -Djpeg=enabled -Dtiff=enabled"
  MESON_TEST_TIMEOUT_MULTIPLIER: 3
  FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gdk-pixbuf/fedora:v4"

.only-default:
  only:
    - branches
  except:
    - tags

.build-linux:
  extends: .only-default
  before_script:
    - mkdir -p _ccache
  script:
    - meson setup ${COMMON_MESON_FLAGS} ${LOADERS_FLAGS} ${BUILD_OPTS} _build .
    - meson compile -C _build
    - .gitlab/scripts/run-tests.sh _build
  artifacts:
    when: always
    name: "gdk-pixbuf-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    paths:
      - "${CI_PROJECT_DIR}/_build/meson-logs"
      - "${CI_PROJECT_DIR}/_build/report-${CI_JOB_NAME}.xml"
    reports:
      junit:
        - "${CI_PROJECT_DIR}/_build/report-${CI_JOB_NAME}.xml"
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - _ccache/

style-check-diff:
  extends: .only-default
  image: $FEDORA_IMAGE
  stage: .pre
  allow_failure: true
  script:
    - .gitlab/scripts/run-style-check-diff.sh

meson-fedora-x86_64:
  stage: build
  extends: .build-linux
  image: ${FEDORA_IMAGE}
  needs: []

macos:
  stage: build
  needs: []
  only:
    - branches@GNOME/gdk-pixbuf
  except:
    - tags
  tags:
    - macos
  before_script:
    - pip3 install --user meson==0.60.1
    - pip3 install --user ninja
    - export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
  script:
    - meson setup -Dintrospection=disabled -Dinstalled_tests=false -Dman=false -Dgtk_doc=false _build
    - meson compile -C _build
  artifacts:
    when: always
    paths:
      - "${CI_PROJECT_DIR}/_build/meson-logs"
  allow_failure: true

msys2-mingw64:
  stage: build
  needs: []
  tags:
    - win32-ps
  variables:
    MSYSTEM: "MINGW64"
    CHERE_INVOKING: "yes"
  script:
    - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
    - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab/ci/test-msys2.sh"
  artifacts:
    name: "gdk-pixbuf-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
    when: always
    paths:
      - _build/meson-logs

release-build:
  stage: build
  extends: .build-linux
  image: ${FEDORA_IMAGE}
  needs: []
  variables:
    BUILD_OPTS: "-Dbuildtype=release"

reference:
  stage: docs
  image: ${FEDORA_IMAGE}
  needs: []
  variables:
    BUILD_OPTS: "-Dbuildtype=release -Dgtk_doc=true"
  script:
    - meson setup ${COMMON_MESON_FLAGS} ${LOADERS_FLAGS} ${BUILD_OPTS} _build .
    - meson compile -C _build
    - mkdir -p _reference
    - mv _build/docs/gdk-pixbuf/ _reference/gdk-pixbuf/
    - mv _build/docs/gdk-pixdata/ _reference/gdk-pixdata/
  artifacts:
    when: on_success
    paths:
      - _reference

static-scan:
  image: $FEDORA_IMAGE
  stage: analysis
  needs: []
  variables:
    BUILD_OPTS: "--buildtype=debug"
  script:
    - meson setup ${COMMON_MESON_FLAGS} ${LOADERS_FLAGS} ${BUILD_OPTS} _scan_build
    - ninja -C _scan_build scan-build
  artifacts:
    paths:
      - _scan_build/meson-logs
  allow_failure: true

# Run tests with the address sanitizer. We need to turn off introspection,
# since it is incompatible with asan
asan-build:
  image: $FEDORA_IMAGE
  tags: [ asan ]
  stage: analysis
  needs: []
  variables:
  script:
    - CC=clang meson setup --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build
    - meson compile -C _build
    - .gitlab/scripts/run-tests.sh _build
  artifacts:
    paths:
      - _build/meson-logs
  allow_failure: true

release-dist:
  stage: build
  image: ${FEDORA_IMAGE}
  needs: []
  variables:
    BUILD_OPTS: "-Dbuildtype=release -Dgtk_doc=true"
  script:
    - meson ${COMMON_MESON_FLAGS} ${LOADERS_FLAGS} ${BUILD_OPTS} _build .
    - meson compile -C _build
    - meson dist -C _build
    - tar -c -J -f _build/gdk-pixbuf-docs-${CI_COMMIT_TAG}.tar.xz _build/docs/gdk-pixbuf/
    - tar -c -J -f _build/gdk-pixdata-docs-${CI_COMMIT_TAG}.tar.xz _build/docs/gdk-pixdata/
  artifacts:
    when: on_success
    paths:
      - _build/meson-dist/gdk-pixbuf-${CI_COMMIT_TAG}.tar.xz
      - _build/gdk-pixbuf-docs-${CI_COMMIT_TAG}.tar.xz
      - _build/gdk-pixdata-docs-${CI_COMMIT_TAG}.tar.xz
  only:
    - tags

pages:
  stage: deploy
  needs: [reference]
  script:
    - mv _reference public
  artifacts:
    paths:
      - public
  only:
    - master