libdisplay-info/.gitlab-ci.yml
Simon Ser 73b763d6b4 ci: fix build stage not run in MRs
See https://docs.gitlab.com/ee/ci/yaml/#rules

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-04-04 21:57:50 +02:00

50 lines
1.2 KiB
YAML

.templates_sha: &templates_sha 3e66ea37e5672bb8f48e3056ba92915b5fc5b888
include:
- project: 'freedesktop/ci-templates'
ref: *templates_sha
file: '/templates/ci-fairy.yml'
- project: 'freedesktop/ci-templates'
ref: *templates_sha
file: '/templates/alpine.yml'
variables:
FDO_UPSTREAM_REPO: 'emersion/libdisplay-info'
FDO_DISTRIBUTION_TAG: '2022-03-24.2'
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 meson'
rules:
- when: on_success
build:
extends: .fdo.distribution-image@alpine
stage: "Build and test"
script:
- meson build/ -Dwerror=true
- ninja -C build/
- ninja -C build/ test
artifacts:
paths:
- build/meson-logs/
rules:
- when: on_success