forked from zeldaret/oot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
166 lines (164 loc) · 4.59 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
pipeline {
agent {
label 'oot'
}
stages {
stage('Check formatting (full)') {
when {
branch 'main'
}
steps {
echo 'Checking formatting on all files...'
sh 'python3 tools/check_format.py'
}
}
stage('Check formatting (modified)') {
when {
not {
branch 'main'
}
}
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
echo 'Checking formatting on modified files...'
sh 'python3 tools/check_format.py --verbose --compare-to origin/main'
}
}
}
// The ROMs are built in an order that maximizes compiler flags coverage in a "fail fast" approach.
// Specifically we start with a retail ROM for BSS ordering, and make sure we cover all of
// N64/GC/NTSC/PAL/MQ/DEBUG as quickly as possible.
stage('Build ntsc-1.0') {
steps {
script {
build('ntsc-1.0', 'oot-ntsc-1.0-us.z64')
}
}
}
stage('Build gc-jp') {
steps {
script {
build('gc-jp', 'oot-gc-jp.z64')
}
}
}
stage('Build gc-eu-mq') {
steps {
script {
build('gc-eu-mq', 'oot-gc-eu-mq.z64')
}
}
}
stage('Build gc-eu-mq-dbg') {
steps {
script {
build('gc-eu-mq-dbg', 'oot-gc-eu-mq-dbg.z64')
}
}
}
stage('Build pal-1.0') {
steps {
script {
build('pal-1.0', 'oot-pal-1.0.z64')
}
}
}
stage('Build ntsc-1.2') {
steps {
script {
build('ntsc-1.2', 'oot-ntsc-1.2-us.z64')
}
}
}
stage('Build gc-us') {
steps {
script {
build('gc-us', 'oot-gc-us.z64')
}
}
}
stage('Build gc-jp-ce') {
steps {
script {
build('gc-jp-ce', 'oot-gc-jp-ce.z64')
}
}
}
stage('Build gc-eu') {
steps {
script {
build('gc-eu', 'oot-gc-eu.z64')
}
}
}
stage('Build gc-jp-mq') {
steps {
script {
build('gc-jp-mq', 'oot-gc-jp-mq.z64')
}
}
}
stage('Build pal-1.1') {
steps {
script {
build('pal-1.1', 'oot-pal-1.1.z64')
}
}
}
stage('Build ntsc-1.1') {
steps {
script {
build('ntsc-1.1', 'oot-ntsc-1.1-us.z64')
}
}
}
stage('Build gc-us-mq') {
steps {
script {
build('gc-us-mq', 'oot-gc-us-mq.z64')
}
}
}
stage('Generate patch') {
when {
not {
branch 'main'
}
}
steps {
sh 'git diff'
echo 'Generating patch...'
sh 'tools/generate_patch_from_jenkins.sh'
}
}
}
post {
always {
echo "Finished, deleting directory."
deleteDir()
}
cleanup {
echo "Clean up in post."
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true)
}
}
}
def build(String version, String rom) {
sh "ln -s /usr/local/etc/roms/${rom} baseroms/${version}/baserom.z64"
sh "make -j\$(nproc) setup VERSION=${version}"
try {
sh "make -j\$(nproc) VERSION=${version}"
} catch (e) {
echo "Build failed, attempting to fix BSS ordering..."
sh ".venv/bin/python3 tools/fix_bss.py -v ${version}"
// If fix_bss.py succeeds, continue the build, but ensure both the build and current stage are marked as failed
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh 'exit 1'
}
} finally {
sh "make clean assetclean VERSION=${version}"
}
}