2022-03-24 01:48:28 +01:00
|
|
|
include:
|
|
|
|
- project: 'freedesktop/ci-templates'
|
2022-09-08 12:19:50 +02:00
|
|
|
ref: 3f37cc0e461f5b0c815409bf6f55759f26a74e9c
|
|
|
|
file:
|
|
|
|
- '/templates/ci-fairy.yml'
|
|
|
|
- '/templates/alpine.yml'
|
2022-03-24 02:20:55 +01:00
|
|
|
|
2022-03-28 11:17:07 +02:00
|
|
|
# When updating the prepare-container step, make sure to bump
|
|
|
|
# FDO_DISTRIBUTION_TAG, otherwise the container won't get rebuilt.
|
2022-06-10 19:44:44 +02:00
|
|
|
# To force a rebuild of the container, use:
|
|
|
|
# $ git push -f -o ci.variable="FDO_FORCE_REBUILD=1"
|
2022-03-24 02:20:55 +01:00
|
|
|
variables:
|
|
|
|
FDO_UPSTREAM_REPO: 'emersion/libdisplay-info'
|
2024-05-10 15:45:20 +02:00
|
|
|
FDO_DISTRIBUTION_TAG: '2024-06-07.0'
|
2022-03-24 01:48:28 +01:00
|
|
|
|
2023-06-26 16:23:15 +02:00
|
|
|
workflow:
|
|
|
|
rules:
|
|
|
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
|
|
- if: $CI_PIPELINE_SOURCE == 'push'
|
|
|
|
|
2022-03-24 01:48:28 +01:00
|
|
|
stages:
|
|
|
|
- "Contribution checks"
|
2022-03-24 02:20:55 +01:00
|
|
|
- "Prepare container"
|
|
|
|
- "Build and test"
|
2023-01-10 15:28:00 +01:00
|
|
|
- "Publish"
|
2022-03-24 01:48:28 +01:00
|
|
|
|
|
|
|
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
|
2022-03-24 02:20:55 +01:00
|
|
|
|
|
|
|
prepare-container:
|
|
|
|
extends: .fdo.container-build@alpine@x86_64
|
|
|
|
stage: "Prepare container"
|
|
|
|
variables:
|
2024-05-10 15:45:20 +02:00
|
|
|
EDID_DECODE_COMMIT: c6b859d7f0251e2433fb81bd3f67bd2011c2036c
|
2023-10-31 13:24:53 +01:00
|
|
|
FDO_BASE_IMAGE: alpine:latest
|
2022-06-16 11:04:00 +02:00
|
|
|
FDO_DISTRIBUTION_PACKAGES: |
|
2022-11-23 01:36:44 +01:00
|
|
|
build-base clang compiler-rt meson make git gcovr py3-pygments go hwdata
|
2022-03-28 11:17:07 +02:00
|
|
|
FDO_DISTRIBUTION_EXEC: |
|
2024-05-10 15:45:20 +02:00
|
|
|
grep $EDID_DECODE_COMMIT ./subprojects/edid-decode.wrap >/dev/null || \
|
|
|
|
(echo "Keep edid-decode.wrap and CI in sync!" && exit 1)
|
2022-03-28 11:17:07 +02:00
|
|
|
git clone git://linuxtv.org/edid-decode.git
|
|
|
|
cd edid-decode
|
2024-05-10 15:45:20 +02:00
|
|
|
git checkout $EDID_DECODE_COMMIT
|
2024-06-05 13:30:38 +02:00
|
|
|
meson setup build/
|
|
|
|
ninja -C build/
|
|
|
|
ninja -C build/ install
|
2022-03-28 11:17:07 +02:00
|
|
|
cd ..
|
|
|
|
rm -rf edid-decode
|
2022-09-28 21:22:09 +02:00
|
|
|
|
|
|
|
go install git.sr.ht/~emersion/gyosu@latest
|
|
|
|
mv ~/go/bin/gyosu /usr/bin/
|
|
|
|
rm -rf ~/go
|
2022-04-04 21:57:50 +02:00
|
|
|
rules:
|
|
|
|
- when: on_success
|
2022-03-24 02:20:55 +01:00
|
|
|
|
2023-02-14 21:58:44 +01:00
|
|
|
testing-check:
|
2023-02-15 12:50:09 +01:00
|
|
|
extends: .fdo.distribution-image@alpine
|
2023-02-27 10:33:47 +01:00
|
|
|
stage: "Build and test"
|
2023-02-15 12:50:09 +01:00
|
|
|
script:
|
|
|
|
- |
|
2023-02-14 21:58:44 +01:00
|
|
|
# Check if the origin of all test EDIDs is documented
|
2023-02-15 12:50:09 +01:00
|
|
|
for f in ./test/data/*.edid; do
|
2023-02-23 20:42:55 +01:00
|
|
|
grep -q "^$(basename ${f%.edid})\s" ./test/data/README.md ||
|
|
|
|
(echo "$f not in README.md" && exit 1)
|
2023-02-15 12:50:09 +01:00
|
|
|
done
|
2023-02-14 21:58:44 +01:00
|
|
|
# Check if the test references checked in the repo match what we have in CI
|
|
|
|
meson setup build/
|
|
|
|
ninja -C build/ gen-test-data
|
|
|
|
git diff --quiet ||
|
|
|
|
(echo "Checked in reference output does not match generated reference output" && exit 1)
|
2023-02-15 12:50:09 +01:00
|
|
|
rules:
|
|
|
|
- when: on_success
|
|
|
|
|
2022-06-16 11:04:00 +02:00
|
|
|
build-gcc:
|
2022-03-24 02:20:55 +01:00
|
|
|
extends: .fdo.distribution-image@alpine
|
|
|
|
stage: "Build and test"
|
|
|
|
script:
|
2022-08-23 23:14:31 +02:00
|
|
|
- CC=gcc meson setup build/ --fatal-meson-warnings -Dwerror=true -Db_coverage=true
|
2022-03-24 02:20:55 +01:00
|
|
|
- ninja -C build/
|
|
|
|
- ninja -C build/ test
|
2022-06-16 11:06:03 +02:00
|
|
|
- ninja -C build/ -j1 coverage-xml coverage-html
|
2022-03-24 02:20:55 +01:00
|
|
|
artifacts:
|
2022-05-25 11:26:37 +02:00
|
|
|
when: always
|
2022-03-24 02:20:55 +01:00
|
|
|
paths:
|
|
|
|
- build/meson-logs/
|
2022-06-06 15:37:16 +02:00
|
|
|
reports:
|
|
|
|
junit: build/meson-logs/testlog.junit.xml
|
2022-06-06 15:32:58 +02:00
|
|
|
coverage_report:
|
|
|
|
coverage_format: cobertura
|
|
|
|
path: build/meson-logs/coverage.xml
|
2022-04-04 21:57:50 +02:00
|
|
|
rules:
|
|
|
|
- when: on_success
|
2022-06-16 11:04:00 +02:00
|
|
|
|
|
|
|
build-clang:
|
|
|
|
extends: .fdo.distribution-image@alpine
|
|
|
|
stage: "Build and test"
|
|
|
|
script:
|
2022-08-23 23:14:31 +02:00
|
|
|
- CC=clang meson setup build/ --fatal-meson-warnings -Dwerror=true -Db_sanitize=address,undefined -Db_lundef=false
|
2022-06-16 11:04:00 +02:00
|
|
|
- ninja -C build/
|
2023-10-31 12:20:35 +01:00
|
|
|
- UBSAN_OPTIONS=halt_on_error=1 ninja -C build/ test
|
2022-06-16 11:04:00 +02:00
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- build/meson-logs/
|
|
|
|
reports:
|
|
|
|
junit: build/meson-logs/testlog.junit.xml
|
|
|
|
rules:
|
|
|
|
- when: on_success
|
2022-09-28 21:22:09 +02:00
|
|
|
|
2023-01-10 15:28:00 +01:00
|
|
|
build-docs:
|
2022-09-28 21:22:09 +02:00
|
|
|
extends: .fdo.distribution-image@alpine
|
|
|
|
stage: "Build and test"
|
|
|
|
script:
|
|
|
|
- gyosu -I$PWD/include/ -fexported-symbols='di_*'
|
|
|
|
-ffile-prefix-map=$PWD/include/= -fsite-name=libdisplay-info
|
|
|
|
-o public $PWD/include/libdisplay-info/
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public/
|
2023-01-10 15:28:00 +01:00
|
|
|
rules:
|
|
|
|
- when: on_success
|
|
|
|
|
|
|
|
pages:
|
|
|
|
extends: .fdo.distribution-image@alpine
|
|
|
|
stage: "Publish"
|
|
|
|
script:
|
|
|
|
- "true"
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public/
|
2022-09-28 21:22:09 +02:00
|
|
|
rules:
|
|
|
|
- if: '$CI_PROJECT_PATH == "emersion/libdisplay-info" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
|
|
when: on_success
|
|
|
|
- when: never
|