From d49c8f78fead4eb99ecd04f51f0b3dc0d39fb0e2 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Thu, 7 Jul 2022 14:57:08 +0100 Subject: [PATCH] tests: Use pre-commit to run some tests in Jenkins The pre-commit tool is able to run style tests in a reproducible manner. Run pre-commit from Jenkins. Change-Id: Ia142a6f3b610410b5767515483b90bc3a09f2407 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61113 Tested-by: kokoro Reviewed-by: Bobby Bruce Reviewed-by: Jason Lowe-Power --- tests/jenkins/presubmit-stage2.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/jenkins/presubmit-stage2.sh b/tests/jenkins/presubmit-stage2.sh index 6e73394a0d..d3f1100f07 100755 --- a/tests/jenkins/presubmit-stage2.sh +++ b/tests/jenkins/presubmit-stage2.sh @@ -37,6 +37,10 @@ set -e +# Run pre-commit style checks +PRE_COMMIT_HOME=/tmp/pre-commit-cache pre-commit run \ + --from-ref HEAD~ --to-ref HEAD + # Use ccache with the default directory for caching #XXX Not available in docker image. #export PATH="/usr/lib/ccache:$PATH"