From 51f5cab76cc61c34a05f1802b702f578523b9602 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Mon, 22 May 2023 19:14:58 +0300 Subject: [PATCH] .gitlab-ci.yml: attempt to import pre-commit --- .gitignore | 1 + .gitlab-ci.yml | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 092679b..277d86a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ _site *~ keys.txt.asc .bundle +.cache/** .jekyll-cache .jekyll-metadata vendor/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b959bb..3bdeb5d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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