# Continuous Integration configuration for at-spi2-core # # For documentation on how this works, see devel-docs/gitlab-ci.md # # Full documentation for Gitlab CI: https://docs.gitlab.com/ee/ci/ # # Introduction to Gitlab CI: https://docs.gitlab.com/ee/ci/quick_start/index.html variables: OPENSUSE_TUMBLEWEED_IMAGE: "registry.gitlab.gnome.org/gnome/at-spi2-core/opensuse:latest" # Stages in the CI pipeline in which jobs will be run stages: # - style-check - build - analysis - docs - deploy # Base definition for jobs. # # We have the package dependencies to install on top of a stock opensuse/tumbleweed image, # and the rules for when to run each job (on merge requests and on personal branches). .only-default: only: - merge_requests - branches except: - tags # C coding style checker. # # Disabled for now, since we need to decide to reindent all the code first. # # style-check-diff: # extends: .only-default # image: fedora:latest # stage: style-check # script: # - dnf install -y clang-tools-extra curl diffutils git # - sh -x ./.gitlab-ci/run-style-check.sh # Template for the default build recipe. # # Depends on these variables: # @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation .build-default: image: $OPENSUSE_TUMBLEWEED_IMAGE extends: .only-default script: - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build . - meson compile -C _build - meson install -C _build - mkdir /tmp/test+dir+with+funny+chars - export XDG_RUNTIME_DIR=/tmp/test+dir+with+funny+chars # See https://gitlab.gnome.org/GNOME/at-spi2-core/-/issues/48 - dbus-run-session -- .gitlab-ci/run-tests.sh artifacts: reports: junit: "_build/meson-logs/testlog.junit.xml" when: always name: "at-spi2-core-${CI_COMMIT_REF_NAME}" paths: - "${CI_PROJECT_DIR}/_build/meson-logs" - "${CI_PROJECT_DIR}/_build/atspi/Atspi-2.0.gir" # Inherit to build the API reference via gi-docgen # @PROJECT_DEPS: the dependencies of the project (on Fedora) # @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation # @DOCS_FLAGS: doc-related arguments for the meson setup invocation # @DOCS_PATH: the docs output directory under the build directory # .gidocgen-build: # image: fedora:latest # before_script: # - export PATH="$HOME/.local/bin:$PATH" # - dnf install -y python3 python3-pip python3-wheel gobject-introspection-devel graphviz ninja-build redhat-rpm-config # - dnf install -y ${PROJECT_DEPS} # - pip3 install --user meson==${MESON_VERSION} gi-docgen jinja2 Markdown markupsafe pygments toml typogrify # script: # - meson setup ${MESON_EXTRA_FLAGS} ${DOCS_FLAGS} _docs . # - meson compile -C _docs # - | # pushd "_docs/${DOCS_PATH}" > /dev/null # tar cf ${CI_PROJECT_NAME}-docs.tar . # popd > /dev/null # - mv _docs/${DOCS_PATH}/${CI_PROJECT_NAME}-docs.tar . # artifacts: # when: always # name: 'Documentation' # expose_as: 'Download the API reference' # paths: # - ${CI_PROJECT_NAME}-docs.tar # Build and run the test suite. # # Look at .build-default for where the artifacts are stored (build/test logs, built binaries). opensuse-x86_64: extends: .build-default stage: build needs: [] variables: MESON_EXTRA_FLAGS: "--buildtype=debug" # -Dwerror=true # Run static analysis on the code. # # The logs are part of the compilation stderr. static-scan: image: $OPENSUSE_TUMBLEWEED_IMAGE stage: analysis needs: [] variables: MESON_EXTRA_FLAGS: "--buildtype=debug -Dintrospection=no -Ddocs=false" script: - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _scan_build . - ninja -C _scan_build scan-build artifacts: name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" when: always paths: - "_scan_build/meson-logs/scanbuild" # Build and run with address sanitizer (asan). asan-build: image: $OPENSUSE_TUMBLEWEED_IMAGE stage: analysis needs: [] variables: MESON_EXTRA_FLAGS: "--buildtype=debug -Db_sanitize=address -Db_lundef=false -Dintrospection=no -Ddocs=false" script: - CC=clang meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build . - meson compile -C _build - meson install -C _build - dbus-run-session -- .gitlab-ci/run-tests.sh artifacts: name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" when: always paths: - "_asan_build/meson-logs" allow_failure: true # Run the test suite and extract code coverage information. # # See the _coverage/ artifact for the HTML report. coverage: image: $OPENSUSE_TUMBLEWEED_IMAGE stage: analysis needs: [] variables: MESON_EXTRA_FLAGS: "--buildtype=debug -Ddocs=false -Dintrospection=no" CFLAGS: "-coverage -ftest-coverage -fprofile-arcs" script: - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build . - meson compile -C _build - meson install -C _build - mkdir -p _coverage - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov" - dbus-run-session -- .gitlab-ci/run-tests.sh - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov" - bash -x .gitlab-ci/gen-coverage.sh - mkdir -p public/ - cp -r _coverage public/coverage coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/' artifacts: name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" expire_in: 2 days when: always paths: - "_build/meson-logs" - public # Build the reference documentation. # # reference: # stage: docs # needs: [] # extends: .gidocgen-build # variables: # PROJECT_DEPS: # gdk-pixbuf2-devel # geocode-glib-devel # gettext # git # gobject-introspection-devel # itstool # libsoup-devel # libxml2-devel # ninja-build # pylint # python3 # python3-gobject # python3-pip # python3-wheel # redhat-rpm-config # vala # MESON_VERSION: "0.55.3" # DOCS_FLAGS: -Dgtk_doc=true # DOCS_PATH: doc/libgweather-4.0 # # # Publish the generated HTML reference documentation. # # pages: # stage: deploy # needs: ['reference'] # script: # - mkdir public && cd public # - tar xf ../${CI_PROJECT_NAME}-docs.tar # artifacts: # paths: # - public # only: # - master # - main # Publish the test coverage report pages: stage: deploy needs: [ coverage ] script: - echo # dummy - contents were generated in another job artifacts: paths: - public rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH