mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-26 17:31:45 +02:00
Switch to GitHub Actions
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
This commit is contained in:

committed by
afayaz-feral

parent
6c60565f33
commit
ab06ba419e
@ -10,6 +10,21 @@ if [[ "$1" == "--pre-commit" ]]; then
|
||||
git-clang-format
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "$CI" == "true" ]]; then
|
||||
# used in ci, assumes clean repo
|
||||
clang-format -i $(find . -name '*.[ch]' -not -path "*subprojects/*")
|
||||
GIT_DIFF_OUTPUT=$(git diff)
|
||||
if [[ ! -z ${GIT_DIFF_OUTPUT} ]]; then
|
||||
echo "Failed clang format check:"
|
||||
echo "${GIT_DIFF_OUTPUT}"
|
||||
exit 1
|
||||
else
|
||||
echo "Passed clang format check"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
CLANG_FORMAT_OUTPUT=$(git-clang-format HEAD^ HEAD --diff)
|
||||
if [[ ! ${CLANG_FORMAT_OUTPUT} == "no modified files to format" ]] && [[ ! -z ${CLANG_FORMAT_OUTPUT} ]]; then
|
||||
echo "Failed clang format check:"
|
||||
@ -17,4 +32,5 @@ if [[ ! ${CLANG_FORMAT_OUTPUT} == "no modified files to format" ]] && [[ ! -z ${
|
||||
exit 1
|
||||
else
|
||||
echo "Passed clang format check"
|
||||
exit 0
|
||||
fi
|
||||
|
@ -1,11 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit on failure
|
||||
set -e
|
||||
# Ensure we are at the project root
|
||||
cd "$(dirname $0)"/..
|
||||
|
||||
# Collect scan-build output
|
||||
ninja scan-build -C builddir | tee /tmp/scan-build-results.txt
|
||||
ninja scan-build -C builddir | tee builddir/meson-logs/scan-build.txt
|
||||
|
||||
# Invert the output - if this string exists it's a fail
|
||||
! grep -E '[0-9]+ bugs? found.' /tmp/scan-build-results.txt
|
||||
|
||||
exit ! grep -E '[0-9]+ bugs? found.' builddir/meson-logs/scan-build.txt
|
||||
|
Reference in New Issue
Block a user