From a35fb56d45a3aa68f09f7864908daa7d773d697c Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 13 Nov 2024 12:30:11 +0100 Subject: [PATCH] feat(ci): add pre-commit CI configuration for Node and Go This change introduces GitLab CI configurations for running pre-commit hooks on both Node and Go projects. It sets up the pre-commit environment, ensures necessary dependencies are installed, and runs pre-commit checks on all files to maintain code quality and consistency. This automation helps to catch issues early in the development process. --- Pre-Commit-Go.gitlab-ci.yml | 13 +++++++++++++ Pre-Commit-Node.gitlab-ci.yml | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Pre-Commit-Go.gitlab-ci.yml create mode 100644 Pre-Commit-Node.gitlab-ci.yml diff --git a/Pre-Commit-Go.gitlab-ci.yml b/Pre-Commit-Go.gitlab-ci.yml new file mode 100644 index 0000000..7cc7dc5 --- /dev/null +++ b/Pre-Commit-Go.gitlab-ci.yml @@ -0,0 +1,13 @@ +run-pre-commit: + stage: .pre + image: unbound/pre-commit@sha256:596abf501d5ac878534b76f19d19ec5c952f1f362ad92d611172072ef5d483d5 + variables: + PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit + cache: + - key: + files: + - .pre-commit-config.yaml + paths: + - ${PRE_COMMIT_HOME} + script: + - pre-commit run --all-files diff --git a/Pre-Commit-Node.gitlab-ci.yml b/Pre-Commit-Node.gitlab-ci.yml new file mode 100644 index 0000000..bbcdf04 --- /dev/null +++ b/Pre-Commit-Node.gitlab-ci.yml @@ -0,0 +1,15 @@ +run-pre-commit: + stage: .pre + image: unbound/pre-commit-node:v0.0.10@sha256:b2133622f54309b9cab90876f07b73e2e0532ad67d4bc94d8deafc9df7d779aa + variables: + PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit + cache: + - key: + files: + - .pre-commit-config.yaml + paths: + - ${PRE_COMMIT_HOME} + before_script: + - npm ci --no-progress + script: + - pre-commit run --all-files -- 2.52.0