2020-08-15 06:12:23 +02:00
pipeline {
2021-01-18 14:05:32 +01:00
agent {
2021-03-23 03:22:30 +01:00
label 'papermario'
2021-01-18 14:05:32 +01:00
}
2020-08-15 06:12:23 +02:00
stages {
stage('Setup') {
steps {
2021-02-22 10:21:23 +01:00
sh 'cp /usr/local/etc/roms/papermario.us.z64 ver/us/baserom.z64'
sh 'cp /usr/local/etc/roms/papermario.jp.z64 ver/jp/baserom.z64'
2023-03-08 16:40:22 +01:00
sh 'cp /usr/local/etc/roms/papermario.ique.z64 ver/ique/baserom.z64'
2023-03-13 00:08:06 +01:00
sh 'cp /usr/local/etc/roms/papermario.pal.z64 ver/pal/baserom.z64'
2021-08-22 23:55:26 +02:00
sh 'curl -L "https://github.com/pmret/gcc-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
sh 'curl -L "https://github.com/pmret/binutils-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
2023-01-02 09:17:52 +01:00
sh 'curl -L "https://github.com/decompals/ido-static-recomp/releases/download/v0.2/ido-5.3-recomp-ubuntu-latest.tar.gz" | tar zx -C tools/build/cc/ido5.3'
2022-01-29 02:01:26 +01:00
sh 'curl -L "https://github.com/decompals/mips-gcc-2.7.2/releases/download/main/gcc-2.7.2-linux.tar.gz" | tar zx -C tools/build/cc/gcc2.7.2'
sh 'curl -L "https://github.com/decompals/mips-binutils-2.6/releases/download/main/binutils-2.6-linux.tar.gz" | tar zx -C tools/build/cc/gcc2.7.2'
2023-08-16 19:29:21 +02:00
sh 'curl -L "https://github.com/decompals/mips-binutils-egcs-2.9.5/releases/latest/download/mips-binutils-egcs-2.9.5-linux.tar.gz" | tar zx -C tools/build/cc/egcs'
sh 'curl -L "https://github.com/decompals/mips-gcc-egcs-2.91.66/releases/latest/download/mips-gcc-egcs-2.91.66-linux.tar.gz" | tar zx -C tools/build/cc/egcs'
2022-10-15 00:21:50 +02:00
sh 'pip install -U -r requirements.txt'
2023-07-18 10:53:53 +02:00
sh 'cargo install pigment64'
2021-08-29 18:48:23 +02:00
sh './configure'
2020-08-15 06:12:23 +02:00
}
}
stage('Build') {
steps {
2021-09-22 13:40:16 +02:00
sh "bash -o pipefail -c 'ninja 2>&1 | tee build_log.txt'"
2020-08-15 06:12:23 +02:00
}
}
2021-08-24 12:22:24 +02:00
stage("Comment") {
when {
not {
2023-03-08 17:55:54 +01:00
branch 'main'
2021-08-24 12:22:24 +02:00
}
}
steps {
script {
if (env.CHANGE_ID) {
def us_progress = sh(returnStdout: true, script: "python3 progress.py us --pr-comment").trim()
def jp_progress = sh(returnStdout: true, script: "python3 progress.py jp --pr-comment").trim()
2023-03-08 16:58:19 +01:00
def ique_progress = sh(returnStdout: true, script: "python3 progress.py ique --pr-comment").trim()
2023-03-13 00:08:06 +01:00
def pal_progress = sh(returnStdout: true, script: "python3 progress.py pal --pr-comment").trim()
2021-08-29 18:48:23 +02:00
def warnings = sh(returnStdout: true, script: "./tools/warnings_count/check_new_warnings.sh --jenkins").trim()
2021-08-24 12:22:24 +02:00
def comment_id = -1
for (comment in pullRequest.comments) {
if (comment.user == "BowserSlug") {
comment_id = comment.id
}
}
2023-03-13 00:08:06 +01:00
def message = "${us_progress}\n${jp_progress}\n${ique_progress}\n${pal_progress}\n${warnings}"
2021-08-24 12:22:24 +02:00
2023-03-13 00:08:06 +01:00
if (message != "\n\n\n\n") {
2021-10-03 19:42:38 +02:00
if (comment_id == -1) {
2023-02-22 09:03:47 +01:00
echo message
2021-10-03 19:42:38 +02:00
pullRequest.comment(message)
} else {
pullRequest.editComment(comment_id, message)
2021-08-24 12:22:24 +02:00
}
}
}
}
}
}
2021-01-04 14:50:33 +01:00
stage('Report Progress') {
when {
2023-03-08 17:55:54 +01:00
branch 'main'
2021-01-04 14:50:33 +01:00
}
steps {
2021-03-23 03:22:30 +01:00
sh 'mkdir reports'
sh 'python3 progress.py us --csv >> reports/progress_us.csv'
sh 'python3 progress.py us --shield-json > reports/progress_us_shield.json'
sh 'python3 progress.py jp --csv >> reports/progress_jp.csv'
sh 'python3 progress.py jp --shield-json > reports/progress_jp_shield.json'
2023-03-08 16:58:19 +01:00
sh 'python3 progress.py ique --csv >> reports/progress_ique.csv'
sh 'python3 progress.py ique --shield-json > reports/progress_ique_shield.json'
2023-02-21 15:37:27 +01:00
2023-03-13 00:08:06 +01:00
sh 'python3 progress.py pal --csv >> reports/progress_pal.csv'
sh 'python3 progress.py pal --shield-json > reports/progress_pal_shield.json'
2021-09-22 13:17:46 +02:00
sh 'cat build_log.txt | grep warning | sort > tools/warnings_count/warnings.txt'
2021-08-24 15:30:35 +02:00
sh 'cp tools/warnings_count/warnings.txt reports/warnings.txt'
2021-03-23 03:22:30 +01:00
stash includes: 'reports/*', name: 'reports'
}
}
stage('Update Progress') {
when {
2023-03-08 17:55:54 +01:00
branch 'main'
2021-03-23 03:22:30 +01:00
}
agent {
2023-03-08 17:55:54 +01:00
label 'pm_website'
2021-03-23 03:22:30 +01:00
}
steps {
unstash 'reports'
sh 'cat reports/progress_us.csv >> /var/www/papermar.io/html/reports/progress_us.csv'
sh 'cat reports/progress_us_shield.json > /var/www/papermar.io/html/reports/progress_us_shield.json'
2021-02-22 10:21:23 +01:00
2021-03-23 03:22:30 +01:00
sh 'cat reports/progress_jp.csv >> /var/www/papermar.io/html/reports/progress_jp.csv'
sh 'cat reports/progress_jp_shield.json > /var/www/papermar.io/html/reports/progress_jp_shield.json'
2021-08-24 15:30:35 +02:00
2023-03-08 16:58:19 +01:00
sh 'cat reports/progress_ique.csv >> /var/www/papermar.io/html/reports/progress_ique.csv'
sh 'cat reports/progress_ique_shield.json > /var/www/papermar.io/html/reports/progress_ique_shield.json'
2023-02-21 15:37:27 +01:00
2023-03-13 00:08:06 +01:00
sh 'cat reports/progress_pal.csv >> /var/www/papermar.io/html/reports/progress_pal.csv'
sh 'cat reports/progress_pal_shield.json > /var/www/papermar.io/html/reports/progress_pal_shield.json'
2021-08-24 15:30:35 +02:00
sh 'cat reports/warnings.txt > /var/www/papermar.io/html/reports/warnings.txt'
2021-01-04 14:50:33 +01:00
}
}
2020-08-15 06:12:23 +02:00
}
2021-08-24 12:22:24 +02:00
post {
always {
cleanWs()
}
}
2020-08-15 06:12:23 +02:00
}