summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: a9b5b3cc16a872d8ee8f50817c29f8c71d8d8dd8 (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
# Currently we track two versions of gcc: gcc-9 and gcc-10.

image: ubuntu:devel

stages:
  - sigc
  - build
  - deploy

variables:
  MESON_DEPS: g++
              gettext
              git
              yelp-tools
              gtk-doc-tools
              python3-pygments
              python3-setuptools
              libglib2.0-dev
              mm-common
              libxml-libxml-perl
              meson
              ninja-build
              glib-networking
  GIO_EXTRA_MODULES: "/usr/lib/x86_64-linux-gnu/gio/modules"
  GIT_SUBMODULE_STRATEGY: normal

.build_default:
  before_script:
    - export DEBIAN_FRONTEND=noninteractive
    - apt update && apt -y upgrade && apt -y install $DEPENDENCIES

build_sigc:
  extends: .build_default
  stage: sigc
  variables:
    DEPENDENCIES: $MESON_DEPS
  script:
    - ls -l libsigc
    - git clone --branch 3.0.7 --depth 1 https://github.com/libsigcplusplus/libsigcplusplus libsigc
    - cd libsigc
    - mkdir _build && cd _build
    - meson --prefix=/usr --libdir=lib -Dwarnings=fatal -Dbuild-examples=false -Dbuildtype=release
    - meson compile
  cache:
    key: build-sigc
    paths:
      - libsigc/

autotools_build:
  extends: .build_default
  stage: build
  variables:
    DEPENDENCIES: $MESON_DEPS make autoconf
  script:
    - ninja -C libsigc/_build install
    - ./autogen.sh --enable-warnings=fatal --prefix=/usr
    - make
    - make check
    - make install
  cache:
    key: build-sigc
    paths:
      - libsigc/
  allow_failure: true

debug_build:
  extends: .build_default
  stage: build
  variables:
    DEPENDENCIES: $MESON_DEPS
  script:
    - ninja -C libsigc/_build install
    - mkdir _build && cd _build
    # -Ddebug=true + -Doptimization=0 correspond to -Dbuildtype=debug
    - meson --prefix=/usr --libdir=lib -Ddebug=true -Doptimization=0 -Dwarnings=fatal
    - meson compile
    - meson test
    - meson install
  cache:
    key: build-sigc
    paths:
      - libsigc/
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/testlog.txt
      - _build/meson-logs/meson-log.txt
    expire_in: 1 week

release_gcc_9_build:
  extends: .build_default
  stage: build
  variables:
    DEPENDENCIES: $MESON_DEPS g++-9
  script:
    - ninja -C libsigc/_build install
    - mkdir _build && cd _build
    # -Ddebug=false + -Doptimization=3 correspond to -Dbuildtype=release
    - CC=gcc-9 CXX=g++-9 meson --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=fatal
    - meson compile
    - meson test
    - meson install
  cache:
    key: build-sigc
    paths:
      - libsigc/
  artifacts:
    when: always
    paths:
      - _build/docs/reference

release_gcc_10_build:
  extends: .build_default
  stage: build
  variables:
    DEPENDENCIES: $MESON_DEPS g++-10
  script:
    - ninja -C libsigc/_build install
    - mkdir _build && cd _build
    # -Ddebug=false + -Doptimization=3 correspond to -Dbuildtype=release
    - CC=gcc-10 CXX=g++-10 meson --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=fatal
    - meson compile
    - meson test
    - meson install
  allow_failure: true
  cache:
    key: build-sigc
    paths:
      - libsigc/
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/testlog.txt
      - _build/meson-logs/meson-log.txt
    expire_in: 1 week

release_clang_build:
  extends: .build_default
  stage: build
  variables:
    DEPENDENCIES: $MESON_DEPS clang
  script:
    - ninja -C libsigc/_build install
    - mkdir _build && cd _build
    # -Ddebug=false + -Doptimization=3 correspond to -Dbuildtype=release
    - CC=clang CXX=clang++ meson --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=fatal
    - meson compile
    - meson test
    - meson install
  allow_failure: true
  cache:
    key: build-sigc
    paths:
      - libsigc/
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/testlog.txt
      - _build/meson-logs/meson-log.txt
    expire_in: 1 week

pages:
  stage: deploy
  needs: [release_gcc_9_build]
  script:
    - mkdir public
    - mv _build/docs/reference/html/* public
  artifacts:
    paths:
      - public
  only:
    refs:
      - kjellahl/testci