add .gitlab-ci.yml and pre-commit configuration

This commit is contained in:
Aminda Suomalainen 2023-05-22 16:54:10 +03:00
parent d6bb4e712b
commit 4fcc867d13
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 22 additions and 7 deletions

15
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,15 @@
# Based on https://pre-commit.com
image: python:alpine
gitlab-ci-pre-commit:
stage: build
before_script:
- apk update && apk add git gcc musl-dev
- pip install pre-commit
script:
- pre-commit run --all-files --show-diff-on-failure
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
TERM: dumb
cache:
paths:
- ${PRE_COMMIT_HOME}

View File

@ -43,13 +43,13 @@ repos:
# - id: mypy
# GitHub Actions etc. configuration validity checking
# - repo: https://github.com/python-jsonschema/check-jsonschema
# rev: 0.23.0
# hooks:
# - id: check-dependabot
# - id: check-github-actions
# - id: check-github-workflows
# - id: check-gitlab-ci
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.0
hooks:
#- id: check-dependabot
#- id: check-github-actions
#- id: check-github-workflows
- id: check-gitlab-ci
# - repo: https://github.com/jumanjihouse/pre-commit-hooks
# rev: 3.0.0