mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
Check formatting in CI (#1652)
* Check formatting in CI
* Move deleteDir() to cleanup section
* Revert "Move deleteDir() to cleanup section"
This reverts commit 4b0dd80cac
.
* Give up on check_format.txt
* Fix formatting
This commit is contained in:
parent
8af0919e7d
commit
6e0d67f9ec
3 changed files with 31 additions and 2 deletions
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
|
@ -4,6 +4,12 @@ pipeline {
|
|||
}
|
||||
|
||||
stages {
|
||||
stage('Check formatting') {
|
||||
steps {
|
||||
echo 'Checking formatting...'
|
||||
sh 'tools/check_format.sh'
|
||||
}
|
||||
}
|
||||
stage('Setup') {
|
||||
steps {
|
||||
sh 'cp /usr/local/etc/roms/baserom_oot.z64 baseroms/gc-eu-mq-dbg/baserom.z64'
|
||||
|
|
23
tools/check_format.sh
Executable file
23
tools/check_format.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
STATUSOLD=`git status --porcelain`
|
||||
./format.py -j
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Formatter failed. Exiting."
|
||||
exit -1
|
||||
fi
|
||||
STATUSNEW=`git status --porcelain`
|
||||
|
||||
if [ "${STATUSOLD}" != "${STATUSNEW}" ];
|
||||
then
|
||||
echo ""
|
||||
echo "Misformatted files found. Run ./format.py and verify codegen is not impacted."
|
||||
echo ""
|
||||
diff --unified=0 --label "Old git status" <(echo "${STATUSOLD}") --label "New git status" <(echo "${STATUSNEW}")
|
||||
echo ""
|
||||
echo "Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in a new issue