-
Notifications
You must be signed in to change notification settings - Fork 445
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
237 lines (212 loc) · 5.91 KB
/
.gitlab-ci.yml
File metadata and controls
237 lines (212 loc) · 5.91 KB
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
.disabled_not_a_job_include:
- template: Security/SAST.gitlab-ci.yml
variables:
CI_HAWK_ARTIFACT_NAME: "BizHawk_devbuild_${CI_COMMIT_SHORT_SHA}"
CI_HAWK_ARTIFACT_NAME_TAR: "$CI_HAWK_ARTIFACT_NAME.tar"
CI_HAWK_TMPARTIFACT_NAME: "BizHawk_tempbuild_${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
workflow:
auto_cancel:
on_job_failure: all
stages:
- build
- test
- package
.with_cachix_mono:
before_script:
- nix-env -iA nixpkgs.cachix
- cachix use $CACHIX_CACHE_NAME
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/nixos/nix:latest
variables:
CACHIX_CACHE_NAME: mono-for-bizhawk
.with_dotnet_sdk:
image: mcr.microsoft.com/dotnet/sdk:8.0
build_asms_debug:
artifacts:
expire_in: "30 minutes"
name: "$CI_HAWK_TMPARTIFACT_NAME"
paths:
- output
extends: .with_dotnet_sdk
script:
- Dist/BuildDebug.sh -v normal
stage: build
build_asms_release:
artifacts:
expire_in: "30 minutes"
name: "$CI_HAWK_TMPARTIFACT_NAME"
paths:
- output
extends: .with_dotnet_sdk
script:
- if [ "$CI_COMMIT_REF_SLUG" == "release" ]; then Dist/UpdateVersionInfoForRelease.sh; fi
- Dist/BuildRelease.sh -v normal
stage: build
build_ext_projs:
allow_failure: true
extends: .with_dotnet_sdk
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
script:
- for d in $CI_PROJECT_DIR/ExternalProjects/*; do if [ -e "$d/build_release.sh" -a "$(find "$d" -maxdepth 1 -name '*.csproj' -print -quit)" ]; then cd "$d"; ./build_release.sh -v normal || exit $?; fi; done
stage: test
build_ext_tools:
allow_failure: true
extends: .with_dotnet_sdk
needs:
- build_asms_release
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
script:
- for d in $CI_PROJECT_DIR/ExternalToolProjects/*; do if [ -d "$d" ]; then cd "$d" && ./build_release.sh -v normal; fi; done
stage: test
build_nix_master:
# extends: .with_cachix_mono
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/nixos/nix:latest
needs: []
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
script:
- nix-build --pure -A emuhawk
stage: test
build_nix_prev_release:
# extends: .with_cachix_mono
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/nixos/nix:latest
needs: []
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
script:
- nix-build --pure -A emuhawk-latest
stage: test
check_style:
extends: .with_dotnet_sdk
needs:
- job: build_asms_release
artifacts: false
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
allow_failure: true
- if: $BIZHAWKBUILD_USE_ANALYZERS != null
when: always
allow_failure: false
script:
- Dist/BuildRelease.sh -v normal
stage: test
.disabled_job_infersharp:
artifacts:
paths:
- infer-out/*
image: mcr.microsoft.com/infersharp:v1.0
needs:
- job: build_asms_release
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
script:
- mkdir "infer-in"
- find output -name "BizHawk.*.dll" -exec cp "{}" "infer-in" \;
- cp "output/EmuHawk.exe" "infer-in"
- /app/run_infersharp.sh "infer-in"
stage: test
.package_linux_arm64:
extends: .package_linux_base
variables:
CI_HAWK_RID: "linux-arm64"
.package_linux_base:
artifacts:
expire_in: "1 month"
name: "$CI_HAWK_ARTIFACT_NAME"
paths:
- "$CI_HAWK_ARTIFACT_NAME_TAR"
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/alpine:latest
needs:
- build_asms_release
- job: build_asms_debug
artifacts: false
script:
- Dist/Package.sh "$CI_HAWK_RID"
- cd packaged_output
- tar -cf "../$CI_HAWK_ARTIFACT_NAME_TAR" *
stage: package
.package_linux_x64:
extends: .package_linux_base
variables:
CI_HAWK_RID: "linux-x64"
.package_windows_x64:
artifacts:
expire_in: "1 month"
name: "$CI_HAWK_ARTIFACT_NAME"
paths:
- ./*
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/alpine:latest
needs:
- build_asms_release
- job: build_asms_debug
artifacts: false
script:
- Dist/Package.sh 'windows-x64'
# now we replace $CI_PROJECT_DIR with $CI_PROJECT_DIR/packaged_output, so that the archival step will put everything at the top level
- mv packaged_output ..
- cd ..
- rm -fr $CI_PROJECT_DIR
- mv packaged_output $CI_PROJECT_DIR
stage: package
package_devbuild_linux:
extends: .package_linux_x64
rules:
- if: $CI_COMMIT_REF_SLUG == "master"
when: always
package_devbuild_linux_arm:
extends: .package_linux_arm64
rules:
- if: $CI_COMMIT_REF_SLUG == "master"
when: always
variables:
CI_HAWK_ARTIFACT_NAME_TAR: "${CI_HAWK_ARTIFACT_NAME}_arm64.tar"
package_devbuild_windows:
extends: .package_windows_x64
rules:
- if: $CI_COMMIT_REF_SLUG == "master"
when: always
package_release_linux:
extends: .package_linux_x64
rules:
- if: $CI_COMMIT_REF_SLUG == "release"
when: always
variables:
CI_HAWK_ARTIFACT_NAME: "BizHawk-VERSIONHERE-linux-x64.tar" # .zip is added automatically
CI_HAWK_ARTIFACT_NAME_TAR: "BizHawk-linux-x64-$CI_COMMIT_SHORT_SHA.tar"
package_release_windows:
extends: .package_windows_x64
rules:
- if: $CI_COMMIT_REF_SLUG == "release"
when: always
variables:
CI_HAWK_ARTIFACT_NAME: "BizHawk-VERSIONHERE-win-x64"
run_tests:
artifacts:
paths:
- test_output/*.coverage.xml
reports:
junit:
- test_output/*.coverage.xml
extends: .with_dotnet_sdk
needs:
- job: build_asms_release
artifacts: false
script:
- apt-get update && apt-get install liblua5.4-0
- Dist/BuildTestRelease.sh -v normal -p:TestProjTargetFrameworkOverride=net8.0
stage: test
.disabled_job_sast:
variables:
SAST_EXCLUDED_ANALYZERS: bandit, brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan, phpcs-security-audit, pmd-apex, sobelow, spotbugs
stage: test
.disabled_not_a_job_cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- $HOME/.nuget/packages # probably won't work; set NUGET_PACKAGES to `BizHawk_master/.nuget_packages` and cache that