From 0e1131d97cacbfb974886133f129eff3be6447c7 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 21 Feb 2024 20:03:08 +0100 Subject: [PATCH] Calling bash-unit pre-commit hook in ci + sample setup --- .github/workflows/pre-commit.yml | 7 +++++++ .pre-commit-config.yaml | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 374ba7b..f127a7a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -32,7 +32,14 @@ jobs: run: | set -o pipefail pre-commit gc + # Run default pre-commit hooks pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG} + # Run manual pre-commit hook that runs bash_unit@rev + # defined in .pre-commit-config.yaml + pre-commit run bash-unit --hook-stage manual -a | tee -a ${RAW_LOG} + # Run this version of bash_unit using it's current pre-commit-hook.yaml config + # Useful for testing that the current version works + pre-commit try-repo . --verbose --all-files | tee -a ${RAW_LOG} - name: Convert Raw Log to annotations uses: mdeweerd/logToCheckStyle@v2024.2.3 if: ${{ failure() }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 55f00b4..3b40186 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -83,3 +83,11 @@ repos: language: system entry: bash -c "./bash_unit tests/*" pass_filenames: false + + - repo: https://github.com/pgrange/bash_unit + rev: 308c139639269b89c26911098b7739ee2400fcbd + hooks: + - id: bash-unit + stages: [manual] + always_run: true + verbose: true