diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-04-01 20:32:16 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-01 20:32:16 -0300 |
| commit | 78b87b21fbc11bd50c317e273604ad575ebb5f85 (patch) | |
| tree | 510a5e49a0cf7e31ed959593c619a71d1b414b4c | |
| parent | d66a21685f45d130f980e8a5ec7b08cfe189e40b (diff) | |
Jenkins CI (#8)
* Jenkinsfile
* Fix format path
* I have the stupid
* Change CC_CHECK to gcc
* Update Makefile
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
---------
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
| -rw-r--r-- | Jenkinsfile | 53 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rwxr-xr-x | tools/check_format.sh | 23 |
3 files changed, 78 insertions, 2 deletions
diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..05324d8 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,53 @@ +pipeline { + agent { + label 'af' + } + + options { + ansiColor('xterm') + } + + stages { + stage('Check formatting') { + steps { + echo 'Checking formatting...' + sh 'bash -c "tools/check_format.sh 2>&1 >(tee tools/check_format.txt)"' + } + } + stage('Install Python dependencies') { + steps { + echo 'Installing Python dependencies' + sh 'python3 -m pip install -r requirements.txt -U' + } + } + stage('Copy ROM') { + steps { + echo 'Setting up ROM...' + sh 'cp /usr/local/etc/roms/af.jp.z64 baserom.jp.z64' + } + } + stage('Setup') { + steps { + sh 'bash -c "make -j setup"' + } + } + stage('Extract') { + steps { + sh 'bash -c "make -j extract"' + } + } + stage('Build') { + steps { + sh 'bash -c "make -j uncompressed"' + } + } + } + post { + failure { + sh 'cat tools/check_format.txt' + } + always { + cleanWs() + } + } +} @@ -17,9 +17,9 @@ WERROR ?= 0 KEEP_MDEBUG ?= 0 # Check code syntax with host compiler RUN_CC_CHECK ?= 1 -CC_CHECK_COMP ?= clang +CC_CHECK_COMP ?= gcc # Dump build object files -OBJDUMP_BUILD ?= 1 +OBJDUMP_BUILD ?= 0 # Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk! # In nearly all cases, not having 'mips-linux-gnu-*' binaries on the PATH is indicative of missing dependencies diff --git a/tools/check_format.sh b/tools/check_format.sh new file mode 100755 index 0000000..e614db6 --- /dev/null +++ b/tools/check_format.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +STATUSOLD=`git status --porcelain` +./tools/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 ./tools/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 |
