Merge branch 'mlimonci/enable-pre-commit-ci' into 'main'

Enable CI jobs for merge requests

See merge request kernel-firmware/linux-firmware!3
This commit is contained in:
Josh Boyer 2023-08-31 13:39:48 +00:00
commit 61501389c4
No known key found for this signature in database
3 changed files with 35 additions and 0 deletions

23
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,23 @@
check-commits:
stage: test
image: registry.gitlab.com/kernel-firmware/linux-firmware
script:
- ci-fairy check-commits --signed-off-by
pre-commit:
stage: test
image: registry.gitlab.com/kernel-firmware/linux-firmware
script:
- pre-commit run --all-files
release:
stage: deploy
rules:
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
when: never
- if: $RELEASE_TOKEN
script:
- CI_PUSH_REPO=`echo "$CI_REPOSITORY_URL" | sed 's/^.*@/@/g'`
- git remote set-url --push origin "https://gitlab-ci-token:${RELEASE_TOKEN}$CI_PUSH_REPO"
- git tag `date "+%Y%m%d"`
- git push --tags

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
# Leverage FDO CI fairy, but add pre-commit to it
FROM quay.io/freedesktop.org/ci-templates:ci-fairy-sha256-eb20531b68e57da06f4e631402fd494869b1529e2c4ad05cfe24ef3fb8038815
RUN apk add python3-dev
RUN apk add gcc
RUN apk add musl-dev
RUN apk add git
RUN apk add npm
RUN apk add rdfind
RUN apk add shellcheck
RUN pip install pre-commit --ignore-installed distlib

View File

@ -74,6 +74,7 @@ def main():
[
".gitignore",
".codespell.cfg",
".gitlab-ci.yml",
".pre-commit-config.yaml",
"check_whence.py",
"configure",
@ -81,6 +82,7 @@ def main():
"README.md",
"copy-firmware.sh",
"WHENCE",
"Dockerfile",
]
)
known_prefixes = set(name for name in whence_list if name.endswith("/"))