Add value_text to AtspiAccessibleReadingMaterial
[platform/upstream/at-spi2-core.git] / .gitlab-ci.yml
1 # Continuous Integration configuration for at-spi2-core
2 #
3 # For documentation on how this works, see devel-docs/gitlab-ci.md
4 #
5 # Full documentation for Gitlab CI: https://docs.gitlab.com/ee/ci/
6 #
7 # Introduction to Gitlab CI: https://docs.gitlab.com/ee/ci/quick_start/index.html
8
9 variables:
10   OPENSUSE_TUMBLEWEED_IMAGE: "registry.gitlab.gnome.org/gnome/at-spi2-core/opensuse:latest"
11
12 # Stages in the CI pipeline in which jobs will be run
13 stages:
14 #  - style-check
15   - build
16   - analysis
17   - docs
18   - deploy
19
20 # Base definition for jobs.
21 #
22 # We have the package dependencies to install on top of a stock opensuse/tumbleweed image,
23 # and the rules for when to run each job (on merge requests and on personal branches).
24 .only-default:
25   only:
26     - merge_requests
27     - branches
28   except:
29     - tags
30
31 # C coding style checker.
32 #
33 # Disabled for now, since we need to decide to reindent all the code first.
34 #
35 # style-check-diff:
36 #   extends: .only-default
37 #   image: fedora:latest
38 #   stage: style-check
39 #   script:
40 #     - dnf install -y clang-tools-extra curl diffutils git
41 #     - sh -x ./.gitlab-ci/run-style-check.sh
42
43
44 # Template for the default build recipe.
45 #
46 # Depends on these variables:
47 # @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation
48 .build-default:
49   image: $OPENSUSE_TUMBLEWEED_IMAGE
50   extends: .only-default
51   script:
52     - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build .
53     - meson compile -C _build
54     - meson install -C _build
55     - mkdir /tmp/test+dir+with+funny+chars
56     - export XDG_RUNTIME_DIR=/tmp/test+dir+with+funny+chars # See https://gitlab.gnome.org/GNOME/at-spi2-core/-/issues/48
57     - dbus-run-session -- .gitlab-ci/run-tests.sh
58   artifacts:
59     reports:
60       junit: "_build/meson-logs/testlog.junit.xml"
61     when: always
62     name: "at-spi2-core-${CI_COMMIT_REF_NAME}"
63     paths:
64       - "${CI_PROJECT_DIR}/_build/meson-logs"
65       - "${CI_PROJECT_DIR}/_build/atspi/Atspi-2.0.gir"
66
67 # Inherit to build the API reference via gi-docgen
68 # @PROJECT_DEPS: the dependencies of the project (on Fedora)
69 # @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation
70 # @DOCS_FLAGS: doc-related arguments for the meson setup invocation
71 # @DOCS_PATH: the docs output directory under the build directory
72 # .gidocgen-build:
73 #   image: fedora:latest
74 #   before_script:
75 #     - export PATH="$HOME/.local/bin:$PATH"
76 #     - dnf install -y python3 python3-pip python3-wheel gobject-introspection-devel graphviz ninja-build redhat-rpm-config
77 #     - dnf install -y ${PROJECT_DEPS}
78 #     - pip3 install --user meson==${MESON_VERSION} gi-docgen jinja2 Markdown markupsafe pygments toml typogrify
79 #   script:
80 #     - meson setup ${MESON_EXTRA_FLAGS} ${DOCS_FLAGS} _docs .
81 #     - meson compile -C _docs
82 #     - |
83 #       pushd "_docs/${DOCS_PATH}" > /dev/null
84 #       tar cf ${CI_PROJECT_NAME}-docs.tar .
85 #       popd > /dev/null
86 #     - mv _docs/${DOCS_PATH}/${CI_PROJECT_NAME}-docs.tar .
87 #   artifacts:
88 #     when: always
89 #     name: 'Documentation'
90 #     expose_as: 'Download the API reference'
91 #     paths:
92 #       - ${CI_PROJECT_NAME}-docs.tar
93
94 # Build and run the test suite.
95 #
96 # Look at .build-default for where the artifacts are stored (build/test logs, built binaries).
97 opensuse-x86_64:
98   extends: .build-default
99   stage: build
100   needs: []
101   variables:
102     MESON_EXTRA_FLAGS: "--buildtype=debug" # -Dwerror=true
103
104 # Run static analysis on the code.
105 #
106 # The logs are part of the compilation stderr.
107 static-scan:
108   image: $OPENSUSE_TUMBLEWEED_IMAGE
109   stage: analysis
110   needs: []
111   variables:
112     MESON_EXTRA_FLAGS: "--buildtype=debug -Dintrospection=no -Ddocs=false"
113   script:
114     - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _scan_build .
115     - ninja -C _scan_build scan-build
116   artifacts:
117     name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
118     when: always
119     paths:
120       - "_scan_build/meson-logs/scanbuild"
121
122 # Build and run with address sanitizer (asan).
123 asan-build:
124   image: $OPENSUSE_TUMBLEWEED_IMAGE
125   stage: analysis
126   needs: []
127   variables:
128     MESON_EXTRA_FLAGS: "--buildtype=debug -Db_sanitize=address -Db_lundef=false -Dintrospection=no -Ddocs=false"
129   script:
130     - CC=clang meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build .
131     - meson compile -C _build
132     - meson install -C _build
133     - dbus-run-session -- .gitlab-ci/run-tests.sh
134   artifacts:
135     name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
136     when: always
137     paths:
138       - "_asan_build/meson-logs"
139   allow_failure: true
140
141 # Run the test suite and extract code coverage information.
142 #
143 # See the _coverage/ artifact for the HTML report.
144 coverage:
145   image: $OPENSUSE_TUMBLEWEED_IMAGE
146   stage: analysis
147   needs: []
148   variables:
149     MESON_EXTRA_FLAGS: "--buildtype=debug -Ddocs=false -Dintrospection=no"
150     CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
151   script:
152     - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build .
153     - meson compile -C _build
154     - meson install -C _build
155     - mkdir -p _coverage
156     - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
157     - dbus-run-session -- .gitlab-ci/run-tests.sh
158     - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
159     - bash -x .gitlab-ci/gen-coverage.sh
160     - mkdir -p public/
161     - cp -r _coverage public/coverage
162   coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
163   artifacts:
164     name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
165     expire_in: 2 days
166     when: always
167     paths:
168       - "_build/meson-logs"
169       - public
170
171 # Build the reference documentation.
172 #
173 # reference:
174 #   stage: docs
175 #   needs: []
176 #   extends: .gidocgen-build
177 #   variables:
178 #     PROJECT_DEPS:
179 #       gdk-pixbuf2-devel
180 #       geocode-glib-devel
181 #       gettext
182 #       git
183 #       gobject-introspection-devel
184 #       itstool
185 #       libsoup-devel
186 #       libxml2-devel
187 #       ninja-build
188 #       pylint
189 #       python3
190 #       python3-gobject
191 #       python3-pip
192 #       python3-wheel
193 #       redhat-rpm-config
194 #       vala
195 #     MESON_VERSION: "0.55.3"
196 #     DOCS_FLAGS: -Dgtk_doc=true
197 #     DOCS_PATH: doc/libgweather-4.0
198 #
199 #
200 # Publish the generated HTML reference documentation.
201 #
202 # pages:
203 #   stage: deploy
204 #   needs: ['reference']
205 #   script:
206 #     - mkdir public && cd public
207 #     - tar xf ../${CI_PROJECT_NAME}-docs.tar
208 #   artifacts:
209 #     paths:
210 #       - public
211 #   only:
212 #     - master
213 #     - main
214
215 # Publish the test coverage report
216 pages:
217   stage: deploy
218   needs: [ coverage ]
219   script:
220     - echo # dummy - contents were generated in another job
221   artifacts:
222     paths:
223       - public
224   rules:
225     - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH