1 # Continuous Integration configuration for at-spi2-core
3 # For documentation on how this works, see devel-docs/gitlab-ci.md
5 # Full documentation for Gitlab CI: https://docs.gitlab.com/ee/ci/
7 # Introduction to Gitlab CI: https://docs.gitlab.com/ee/ci/quick_start/index.html
10 OPENSUSE_TUMBLEWEED_IMAGE: "registry.gitlab.gnome.org/gnome/at-spi2-core/opensuse:latest"
12 # Stages in the CI pipeline in which jobs will be run
20 # Base definition for jobs.
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).
31 # C coding style checker.
33 # Disabled for now, since we need to decide to reindent all the code first.
36 # extends: .only-default
37 # image: fedora:latest
40 # - dnf install -y clang-tools-extra curl diffutils git
41 # - sh -x ./.gitlab-ci/run-style-check.sh
44 # Template for the default build recipe.
46 # Depends on these variables:
47 # @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation
49 image: $OPENSUSE_TUMBLEWEED_IMAGE
50 extends: .only-default
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
60 junit: "_build/meson-logs/testlog.junit.xml"
62 name: "at-spi2-core-${CI_COMMIT_REF_NAME}"
64 - "${CI_PROJECT_DIR}/_build/meson-logs"
65 - "${CI_PROJECT_DIR}/_build/atspi/Atspi-2.0.gir"
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
73 # image: fedora:latest
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
80 # - meson setup ${MESON_EXTRA_FLAGS} ${DOCS_FLAGS} _docs .
81 # - meson compile -C _docs
83 # pushd "_docs/${DOCS_PATH}" > /dev/null
84 # tar cf ${CI_PROJECT_NAME}-docs.tar .
86 # - mv _docs/${DOCS_PATH}/${CI_PROJECT_NAME}-docs.tar .
89 # name: 'Documentation'
90 # expose_as: 'Download the API reference'
92 # - ${CI_PROJECT_NAME}-docs.tar
94 # Build and run the test suite.
96 # Look at .build-default for where the artifacts are stored (build/test logs, built binaries).
98 extends: .build-default
102 MESON_EXTRA_FLAGS: "--buildtype=debug" # -Dwerror=true
104 # Run static analysis on the code.
106 # The logs are part of the compilation stderr.
108 image: $OPENSUSE_TUMBLEWEED_IMAGE
112 MESON_EXTRA_FLAGS: "--buildtype=debug -Dintrospection=no -Ddocs=false"
114 - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _scan_build .
115 - ninja -C _scan_build scan-build
117 name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
120 - "_scan_build/meson-logs/scanbuild"
122 # Build and run with address sanitizer (asan).
124 image: $OPENSUSE_TUMBLEWEED_IMAGE
128 MESON_EXTRA_FLAGS: "--buildtype=debug -Db_sanitize=address -Db_lundef=false -Dintrospection=no -Ddocs=false"
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
135 name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
138 - "_asan_build/meson-logs"
141 # Run the test suite and extract code coverage information.
143 # See the _coverage/ artifact for the HTML report.
145 image: $OPENSUSE_TUMBLEWEED_IMAGE
149 MESON_EXTRA_FLAGS: "--buildtype=debug -Ddocs=false -Dintrospection=no"
150 CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
152 - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build .
153 - meson compile -C _build
154 - meson install -C _build
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
161 - cp -r _coverage public/coverage
162 coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
164 name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
168 - "_build/meson-logs"
171 # Build the reference documentation.
176 # extends: .gidocgen-build
183 # gobject-introspection-devel
195 # MESON_VERSION: "0.55.3"
196 # DOCS_FLAGS: -Dgtk_doc=true
197 # DOCS_PATH: doc/libgweather-4.0
200 # Publish the generated HTML reference documentation.
204 # needs: ['reference']
206 # - mkdir public && cd public
207 # - tar xf ../${CI_PROJECT_NAME}-docs.tar
215 # Publish the test coverage report
220 - echo # dummy - contents were generated in another job
225 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH