10c072b3f5
[daniels: Only run on MRs.] Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
211 lines
5.1 KiB
YAML
211 lines
5.1 KiB
YAML
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
|
|
|
|
.templates_sha: &template_sha 567700e483aabed992d0a4fea84994a0472deff6 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
|
|
|
variables:
|
|
FDO_UPSTREAM_REPO: wayland/weston
|
|
|
|
|
|
include:
|
|
- project: 'freedesktop/ci-templates'
|
|
ref: *template_sha
|
|
file: '/templates/debian.yml'
|
|
- project: 'freedesktop/ci-templates'
|
|
ref: *template_sha
|
|
file: '/templates/ci-fairy.yml'
|
|
|
|
|
|
stages:
|
|
- review
|
|
- container_prep
|
|
- build
|
|
- pages
|
|
|
|
|
|
.debian:
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: buster
|
|
FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/debian-install.sh'
|
|
FDO_DISTRIBUTION_TAG: '2021-07-31.0-pipewire'
|
|
|
|
.ci-rules:
|
|
rules:
|
|
- when: on_success
|
|
|
|
# does not inherit .ci-rules
|
|
check-commit:
|
|
extends:
|
|
- .fdo.ci-fairy
|
|
stage: review
|
|
rules:
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
when: always
|
|
- when: never
|
|
script:
|
|
- ci-fairy check-commits --signed-off-by --junit-xml=results.xml
|
|
variables:
|
|
GIT_DEPTH: 100
|
|
artifacts:
|
|
reports:
|
|
junit: results.xml
|
|
|
|
|
|
container_prep:
|
|
extends:
|
|
- .ci-rules
|
|
- .debian
|
|
- .fdo.container-build@debian
|
|
timeout: 30m
|
|
stage: container_prep
|
|
|
|
|
|
.build-env:
|
|
extends:
|
|
- .ci-rules
|
|
- .debian
|
|
- .fdo.distribution-image@debian
|
|
timeout: 5m
|
|
stage: build
|
|
variables:
|
|
BUILDDIR: $CI_PROJECT_DIR/build-weston-$CI_JOB_NAME
|
|
PREFIX: $CI_PROJECT_DIR/prefix-weston-$CI_JOB_NAME
|
|
before_script:
|
|
- git clone --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols
|
|
- export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols"
|
|
- export PKG_CONFIG_PATH="$WAYLAND_PROTOCOLS_DIR/share/pkgconfig:$PKG_CONFIG_PATH"
|
|
- export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
|
|
- cd wayland-protocols
|
|
- git show -s HEAD
|
|
- mkdir build
|
|
- cd build
|
|
- ../autogen.sh --prefix="$WAYLAND_PROTOCOLS_DIR"
|
|
- make install
|
|
- cd ../../
|
|
- export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
|
|
- export TESTS_RES_PATH="$BUILDDIR/tests-res.txt"
|
|
- mkdir "$BUILDDIR" "$PREFIX"
|
|
|
|
.build-and-test:
|
|
extends: .build-env
|
|
tags:
|
|
- kvm
|
|
script:
|
|
- export PATH=~/.local/bin:$PATH
|
|
- cd "$BUILDDIR"
|
|
- meson --prefix="$PREFIX" -Db_sanitize=address ${MESON_OPTIONS} ..
|
|
- ninja -k0 -j${FDO_CI_CONCURRENT:-4}
|
|
- ninja install
|
|
- virtme-run --rw --pwd --kimg /weston-virtme/bzImage --kopt quiet --script-dir ../.gitlab-ci/virtme-scripts --qemu-opts -m 4096 -smp ${FDO_CI_CONCURRENT:-4}
|
|
- TEST_RES=$(cat $TESTS_RES_PATH)
|
|
- rm $TESTS_RES_PATH
|
|
- cp -R /weston-virtme ./
|
|
- rm weston-virtme/bzImage
|
|
- exit $TEST_RES
|
|
artifacts:
|
|
name: weston-$CI_COMMIT_SHA
|
|
when: always
|
|
paths:
|
|
- $BUILDDIR/*.png
|
|
- $BUILDDIR/meson-logs
|
|
- $BUILDDIR/weston-virtme
|
|
- $PREFIX
|
|
reports:
|
|
junit: $BUILDDIR/meson-logs/testlog.junit.xml
|
|
|
|
.build-no-test:
|
|
extends: .build-env
|
|
tags:
|
|
- kvm
|
|
script:
|
|
- export PATH=~/.local/bin:$PATH
|
|
- cd "$BUILDDIR"
|
|
- meson --prefix="$PREFIX" ${MESON_OPTIONS} ..
|
|
- ninja -k0 -j${FDO_CI_CONCURRENT:-4}
|
|
- ninja install
|
|
- ninja clean
|
|
artifacts:
|
|
name: weston-$CI_COMMIT_SHA
|
|
when: always
|
|
paths:
|
|
- $BUILDDIR/meson-logs
|
|
- $PREFIX
|
|
|
|
build-full:
|
|
variables:
|
|
MESON_OPTIONS: >
|
|
-Doptimization=0
|
|
-Db_coverage=true
|
|
-Dwerror=true
|
|
-Dtest-skip-is-failure=true
|
|
-Dlauncher-libseat=true
|
|
extends: .build-and-test
|
|
after_script:
|
|
- ninja -C "$BUILDDIR" coverage-html > "$BUILDDIR/meson-logs/ninja-coverage-html.txt"
|
|
- ninja -C "$BUILDDIR" coverage-xml
|
|
- sed -i -e 's/\/build-weston-build-full//' -e 's/\"..\//\"/' "$BUILDDIR/meson-logs/coverage.xml"
|
|
artifacts:
|
|
reports:
|
|
cobertura: $BUILDDIR/meson-logs/coverage.xml
|
|
|
|
build-docs:
|
|
variables:
|
|
MESON_OPTIONS: >
|
|
-Dwerror=true
|
|
-Ddoc=true
|
|
extends: .build-no-test
|
|
|
|
build-no-gl:
|
|
variables:
|
|
MESON_OPTIONS: >
|
|
-Dsimple-clients=damage,im,shm,touch,dmabuf-v4l
|
|
-Drenderer-gl=false
|
|
-Dremoting=false
|
|
-Dpipewire=false
|
|
-Dwerror=true
|
|
-Dlauncher-libseat=true
|
|
extends: .build-and-test
|
|
|
|
docs-and-coverage:
|
|
extends:
|
|
- .ci-rules
|
|
- .debian
|
|
- .fdo.distribution-image@debian
|
|
stage: pages
|
|
timeout: 5m
|
|
script:
|
|
- mv prefix-weston-build-docs/share/doc/weston Documentation
|
|
- mv build-weston-build-full/meson-logs/coveragereport Test_Coverage
|
|
- rm Test_Coverage/gcov.css
|
|
- cp doc/style/lcov-style.css Test_Coverage/gcov.css
|
|
- cp doc/style/*.png Test_Coverage/
|
|
- rm -rf build-* prefix-*
|
|
dependencies:
|
|
- build-docs
|
|
- build-full
|
|
artifacts:
|
|
expose_as: 'Documentation preview and test coverage report'
|
|
paths:
|
|
- Documentation/
|
|
- Test_Coverage/
|
|
|
|
# does not inherit .ci-rules
|
|
pages:
|
|
extends:
|
|
- .debian
|
|
- .fdo.distribution-image@debian
|
|
stage: pages
|
|
timeout: 5m
|
|
dependencies:
|
|
- build-docs
|
|
script:
|
|
- export PREFIX=$(pwd)/prefix-weston-build-docs
|
|
- mkdir public
|
|
- cp -R $PREFIX/share/doc/weston/* public/
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
rules:
|
|
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_PATH == "wayland/weston" && $CI_BUILD_REF_NAME == $CI_DEFAULT_BRANCH'
|
|
when: on_success
|
|
- when: never
|