.gitlab-ci.yml: attempt to import pre-commit

This commit is contained in:
Aminda Suomalainen 2023-05-22 19:14:58 +03:00
parent e6e2a75d18
commit 51f5cab76c
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 20 additions and 4 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ _site
*~
keys.txt.asc
.bundle
.cache/**
.jekyll-cache
.jekyll-metadata
vendor/

View File

@ -1,12 +1,17 @@
# from https://gitlab.com/pages/jekyll/-/blob/master/.gitlab-ci.yml
image: ruby:latest
image: python:alpine
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
LC_ALL: en_US.utf8
TERM: dumb
cache:
paths:
- ${PRE_COMMIT_HOME}
- ${CI_PROJECT_DIR}/bundle
before_script:
- gem install bundler
- apk install --no-cache ruby-bundler
- bundle install
test:
@ -28,3 +33,13 @@ pages:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
gitlab-ci-pre-commit:
stage: build
before_script:
- apk add --no-cache git gcc musl-dev go
- pip install pre-commit
script:
- pre-commit run --all-files --show-diff-on-failure
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit