ci: Add jobs running ci-fairy checks
These can catch various common issues in MR settings and Git commit logs. The "check mr" job only exists in pre-merge pipelines for MRs, and runs automatically. The "check commits" job only exists in pre-merge pipelines for MRs and in pipelines for forked branches. It runs automatically in the former case and can be manually triggered in the latter. v2: * Use git_archive docker image (Daniel Stone) * Use a single sanity stage for both jobs (Tomeu Vizoso) Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6209>
This commit is contained in:
parent
7b09d501e4
commit
4c41d1900e
|
@ -18,6 +18,7 @@ include:
|
||||||
stages:
|
stages:
|
||||||
- container
|
- container
|
||||||
- container-2
|
- container-2
|
||||||
|
- sanity
|
||||||
- git-archive
|
- git-archive
|
||||||
- deploy
|
- deploy
|
||||||
- meson-x86_64
|
- meson-x86_64
|
||||||
|
@ -462,6 +463,11 @@ git_archive:
|
||||||
rules:
|
rules:
|
||||||
- if: *is-scheduled-pipeline
|
- if: *is-scheduled-pipeline
|
||||||
when: always
|
when: always
|
||||||
|
- if: *is-pre-merge
|
||||||
|
when: on_success
|
||||||
|
- if: *is-forked-branch
|
||||||
|
when: manual
|
||||||
|
# Other cases default to never
|
||||||
variables:
|
variables:
|
||||||
FDO_REPO_SUFFIX: &git-archive-suffix "alpine/git_archive"
|
FDO_REPO_SUFFIX: &git-archive-suffix "alpine/git_archive"
|
||||||
FDO_DISTRIBUTION_EXEC: 'pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@6f5af7e5574509726c79109e3c147cee95e81366'
|
FDO_DISTRIBUTION_EXEC: 'pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@6f5af7e5574509726c79109e3c147cee95e81366'
|
||||||
|
@ -470,24 +476,26 @@ git_archive:
|
||||||
FDO_DISTRIBUTION_TAG: &git-archive-tag "2020-07-07"
|
FDO_DISTRIBUTION_TAG: &git-archive-tag "2020-07-07"
|
||||||
FDO_DISTRIBUTION_PACKAGES: git py3-pip
|
FDO_DISTRIBUTION_PACKAGES: git py3-pip
|
||||||
|
|
||||||
|
.use-git_archive:
|
||||||
# Git archive
|
|
||||||
|
|
||||||
make git archive:
|
|
||||||
stage: git-archive
|
|
||||||
extends: .fdo.suffixed-image@alpine
|
extends: .fdo.suffixed-image@alpine
|
||||||
rules:
|
|
||||||
- if: *is-scheduled-pipeline
|
|
||||||
when: on_success
|
|
||||||
# ensure we are running on packet
|
|
||||||
tags:
|
|
||||||
- packet.net
|
|
||||||
variables:
|
variables:
|
||||||
FDO_DISTRIBUTION_TAG: *git-archive-tag
|
FDO_DISTRIBUTION_TAG: *git-archive-tag
|
||||||
FDO_REPO_SUFFIX: *git-archive-suffix
|
FDO_REPO_SUFFIX: *git-archive-suffix
|
||||||
needs:
|
needs:
|
||||||
- git_archive
|
- git_archive
|
||||||
|
|
||||||
|
|
||||||
|
# Git archive
|
||||||
|
|
||||||
|
make git archive:
|
||||||
|
extends: .use-git_archive
|
||||||
|
stage: git-archive
|
||||||
|
rules:
|
||||||
|
- if: *is-scheduled-pipeline
|
||||||
|
when: on_success
|
||||||
|
# ensure we are running on packet
|
||||||
|
tags:
|
||||||
|
- packet.net
|
||||||
script:
|
script:
|
||||||
# compress the current folder
|
# compress the current folder
|
||||||
- tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
|
- tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
|
||||||
|
@ -497,6 +505,38 @@ make git archive:
|
||||||
- ci-fairy minio cp ../$CI_PROJECT_NAME.tar.gz minio://minio-packet.freedesktop.org/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
|
- ci-fairy minio cp ../$CI_PROJECT_NAME.tar.gz minio://minio-packet.freedesktop.org/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
|
||||||
|
|
||||||
|
|
||||||
|
# Sanity checks of MR settings and commit logs
|
||||||
|
.sanity-check:
|
||||||
|
extends: .use-git_archive
|
||||||
|
stage: sanity
|
||||||
|
artifacts:
|
||||||
|
when: on_failure
|
||||||
|
reports:
|
||||||
|
junit: check-*.xml
|
||||||
|
|
||||||
|
check mr:
|
||||||
|
extends: .sanity-check
|
||||||
|
rules:
|
||||||
|
- if: *is-pre-merge
|
||||||
|
when: on_success
|
||||||
|
# Other cases default to never
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml
|
||||||
|
|
||||||
|
check commits:
|
||||||
|
extends: .sanity-check
|
||||||
|
rules:
|
||||||
|
- if: *is-pre-merge
|
||||||
|
when: on_success
|
||||||
|
- if: *is-forked-branch
|
||||||
|
when: manual
|
||||||
|
# Other cases default to never
|
||||||
|
script:
|
||||||
|
- ci-fairy check-commits --junit-xml=check-commits.xml
|
||||||
|
|
||||||
|
|
||||||
# BUILD
|
# BUILD
|
||||||
|
|
||||||
# Shared between windows and Linux
|
# Shared between windows and Linux
|
||||||
|
|
Loading…
Reference in New Issue