libdisplay-info/.gitlab-ci.yml
Simon Ser 2fc4aedee7 ci: simplify ci-templates include
Turns out we can include multiple files with an array instead of
repeating ourselves.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-08 12:19:50 +02:00

83 lines
2.2 KiB
YAML

include:
- project: 'freedesktop/ci-templates'
ref: 3f37cc0e461f5b0c815409bf6f55759f26a74e9c
file:
- '/templates/ci-fairy.yml'
- '/templates/alpine.yml'
# When updating the prepare-container step, make sure to bump
# FDO_DISTRIBUTION_TAG, otherwise the container won't get rebuilt.
# To force a rebuild of the container, use:
# $ git push -f -o ci.variable="FDO_FORCE_REBUILD=1"
variables:
FDO_UPSTREAM_REPO: 'emersion/libdisplay-info'
FDO_DISTRIBUTION_TAG: '2022-08-15.0'
stages:
- "Contribution checks"
- "Prepare container"
- "Build and test"
check-mr:
extends: .fdo.ci-fairy
stage: "Contribution checks"
script:
- ci-fairy check-commits --signed-off-by
- ci-fairy check-merge-request --require-allow-collaboration
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
when: always
- when: never
prepare-container:
extends: .fdo.container-build@alpine@x86_64
stage: "Prepare container"
variables:
FDO_DISTRIBUTION_PACKAGES: |
build-base clang compiler-rt meson make git gcovr py3-pygments
FDO_DISTRIBUTION_EXEC: |
git clone git://linuxtv.org/edid-decode.git
cd edid-decode
git checkout 6816e6a691f40e6fbb64e6d40f012d7727c6315f
make
make install
cd ..
rm -rf edid-decode
rules:
- when: on_success
build-gcc:
extends: .fdo.distribution-image@alpine
stage: "Build and test"
script:
- CC=gcc meson setup build/ --fatal-meson-warnings -Dwerror=true -Db_coverage=true
- ninja -C build/
- ninja -C build/ test
- ninja -C build/ -j1 coverage-xml coverage-html
artifacts:
when: always
paths:
- build/meson-logs/
reports:
junit: build/meson-logs/testlog.junit.xml
coverage_report:
coverage_format: cobertura
path: build/meson-logs/coverage.xml
rules:
- when: on_success
build-clang:
extends: .fdo.distribution-image@alpine
stage: "Build and test"
script:
- CC=clang meson setup build/ --fatal-meson-warnings -Dwerror=true -Db_sanitize=address,undefined -Db_lundef=false
- ninja -C build/
- ninja -C build/ test
artifacts:
when: always
paths:
- build/meson-logs/
reports:
junit: build/meson-logs/testlog.junit.xml
rules:
- when: on_success