2021-12-09 13:44:56 +00:00
.disabled_not_a_job_include :
- template : Security/SAST.gitlab-ci.yml
2021-03-04 10:34:11 +00:00
2020-10-10 19:24:46 +00:00
variables :
2021-01-17 23:51:47 +00:00
CI_HAWK_ARTIFACT_NAME : "BizHawk_devbuild_${CI_COMMIT_SHORT_SHA}"
2021-06-12 14:21:44 +00:00
CI_HAWK_ARTIFACT_NAME_TAR : "$CI_HAWK_ARTIFACT_NAME.tar"
2020-10-10 19:24:46 +00:00
CI_HAWK_TMPARTIFACT_NAME : "BizHawk_tempbuild_${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
2019-12-26 06:57:40 +00:00
stages :
2021-12-09 13:44:56 +00:00
- build
- test
- package
2019-12-26 06:57:40 +00:00
2021-12-09 13:44:56 +00:00
.with_cachix_mono :
2021-12-08 04:41:57 +00:00
before_script :
2021-12-09 13:44:56 +00:00
- nix-env -iA nixpkgs.cachix
- cachix use $CACHIX_CACHE_NAME
2022-10-27 05:36:57 +00:00
image : nixos/nix:latest
2021-12-08 04:41:57 +00:00
variables :
CACHIX_CACHE_NAME : mono-for-bizhawk
2021-12-09 13:47:36 +00:00
build_asms_debug :
artifacts :
expire_in : "30 minutes"
name : "$CI_HAWK_TMPARTIFACT_NAME"
paths :
- output
image : mcr.microsoft.com/dotnet/sdk:6.0
script :
2023-12-22 03:20:19 +00:00
- Dist/BuildDebug.sh -v normal
2021-12-09 13:47:36 +00:00
stage : build
build_asms_release :
2019-12-26 06:57:40 +00:00
artifacts :
expire_in : "30 minutes"
2020-10-10 19:24:46 +00:00
name : "$CI_HAWK_TMPARTIFACT_NAME"
2019-12-26 06:57:40 +00:00
paths :
2021-12-09 13:44:56 +00:00
- output
2021-12-02 21:53:24 +00:00
image : mcr.microsoft.com/dotnet/sdk:6.0
2019-12-26 06:57:40 +00:00
script :
2021-12-09 13:44:56 +00:00
- if [ "$CI_COMMIT_REF_SLUG" == "release" ]; then Dist/UpdateVersionInfoForRelease.sh; fi
2023-12-22 03:20:19 +00:00
- Dist/BuildRelease.sh -v normal
2019-12-26 06:57:40 +00:00
stage : build
2022-09-27 21:20:02 +00:00
build_ext_projs :
allow_failure : true
image : mcr.microsoft.com/dotnet/sdk:6.0
rules :
- if : '$CI_PIPELINE_SOURCE == "schedule"'
when : always
script :
2023-12-22 03:20:19 +00:00
- 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
2022-09-27 21:20:02 +00:00
stage : test
2020-10-10 19:24:46 +00:00
build_ext_tools :
2020-06-06 16:19:01 +00:00
allow_failure : true
2021-12-02 21:53:24 +00:00
image : mcr.microsoft.com/dotnet/sdk:6.0
2020-10-10 19:24:46 +00:00
needs :
2021-12-09 13:47:36 +00:00
- build_asms_release
2020-06-06 16:19:01 +00:00
rules :
2021-12-09 13:44:56 +00:00
- if : '$CI_PIPELINE_SOURCE == "schedule"'
when : always
2020-10-10 19:24:46 +00:00
script :
2023-12-22 03:20:19 +00:00
- for d in $CI_PROJECT_DIR/ExternalToolProjects/*; do if [ -d "$d" ]; then cd "$d" && ./build_release.sh -v normal; fi; done
2020-10-10 19:24:46 +00:00
stage : test
2021-12-08 04:41:57 +00:00
build_nix_master :
2023-11-25 14:20:32 +00:00
# extends: .with_cachix_mono
2023-11-26 10:20:32 +00:00
image : nixos/nix:latest
2021-12-08 04:41:57 +00:00
needs : [ ]
rules :
2021-12-09 13:44:56 +00:00
- if : '$CI_PIPELINE_SOURCE == "schedule"'
when : always
2021-12-08 04:41:57 +00:00
script :
2023-11-25 14:56:06 +00:00
- nix-build --pure -A emuhawk
2021-12-08 04:41:57 +00:00
stage : test
build_nix_prev_release :
2023-11-25 14:20:32 +00:00
# extends: .with_cachix_mono
2023-11-26 10:20:32 +00:00
image : nixos/nix:latest
2021-12-08 04:41:57 +00:00
needs : [ ]
rules :
2021-12-09 13:44:56 +00:00
- if : '$CI_PIPELINE_SOURCE == "schedule"'
when : always
2021-12-08 04:41:57 +00:00
script :
2023-11-25 14:56:06 +00:00
- nix-build --pure -A emuhawk-latest
2021-12-08 04:41:57 +00:00
stage : test
2020-10-10 19:24:46 +00:00
check_style :
2021-12-02 21:53:24 +00:00
image : mcr.microsoft.com/dotnet/sdk:6.0
2020-10-10 19:24:46 +00:00
needs :
2021-12-09 13:47:36 +00:00
- job : build_asms_release
2021-12-09 13:44:56 +00:00
artifacts : false
2020-10-10 19:24:46 +00:00
rules :
2021-12-09 13:44:56 +00:00
- if : '$CI_PIPELINE_SOURCE == "schedule"'
when : always
allow_failure : true
- if : $BIZHAWKBUILD_USE_ANALYZERS != null
when : always
allow_failure : false
2020-05-05 05:46:55 +00:00
script :
2023-12-22 03:20:19 +00:00
- Dist/BuildRelease.sh -v normal -p:RunAnalyzersDuringBuild=true
2020-05-05 05:46:55 +00:00
stage : test
2021-12-09 13:44:56 +00:00
.disabled_job_infersharp :
artifacts :
paths :
- infer-out/*
image : mcr.microsoft.com/infersharp:v1.0
needs :
2021-12-09 13:47:36 +00:00
- job : build_asms_release
2021-12-09 13:44:56 +00:00
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
2021-03-30 19:27:36 +00:00
2021-01-17 23:51:47 +00:00
.package_linux_x64 :
2020-10-10 19:24:46 +00:00
artifacts :
expire_in : "1 month"
2021-06-12 14:21:44 +00:00
name : "$CI_HAWK_ARTIFACT_NAME"
2020-10-10 19:24:46 +00:00
paths :
2021-12-09 13:44:56 +00:00
- "$CI_HAWK_ARTIFACT_NAME_TAR"
2022-10-27 05:36:57 +00:00
image : alpine:latest
2020-10-10 19:24:46 +00:00
needs :
2021-12-09 13:47:36 +00:00
- build_asms_release
- job : build_asms_debug
artifacts : false
2020-10-10 19:24:46 +00:00
script :
2022-10-27 05:36:57 +00:00
- Dist/Package.sh 'linux-x64'
2021-12-09 13:44:56 +00:00
- cd packaged_output
- tar -cf "../$CI_HAWK_ARTIFACT_NAME_TAR" *
2020-10-10 19:24:46 +00:00
stage : package
2021-01-17 23:51:47 +00:00
.package_windows_x64 :
2020-09-19 01:08:34 +00:00
artifacts :
expire_in : "1 month"
2020-10-10 19:24:46 +00:00
name : "$CI_HAWK_ARTIFACT_NAME"
2020-09-19 01:08:34 +00:00
paths :
2021-12-09 13:44:56 +00:00
- ./*
2022-10-27 05:36:57 +00:00
image : alpine:latest
2020-10-10 19:24:46 +00:00
needs :
2021-12-09 13:47:36 +00:00
- build_asms_release
- job : build_asms_debug
artifacts : false
2020-09-19 01:08:34 +00:00
script :
2022-10-27 05:36:57 +00:00
- Dist/Package.sh 'windows-x64'
2021-12-09 13:44:56 +00:00
# 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
2020-09-19 01:08:34 +00:00
stage : package
2021-01-17 23:51:47 +00:00
package_devbuild_linux :
extends : .package_linux_x64
rules :
2021-12-09 13:44:56 +00:00
- if : $CI_COMMIT_REF_SLUG == "master"
when : always
2021-01-17 23:51:47 +00:00
package_devbuild_windows :
extends : .package_windows_x64
rules :
2021-12-09 13:44:56 +00:00
- if : $CI_COMMIT_REF_SLUG == "master"
when : always
2021-01-17 23:51:47 +00:00
package_release_linux :
extends : .package_linux_x64
rules :
2021-12-09 13:44:56 +00:00
- if : $CI_COMMIT_REF_SLUG == "release"
when : always
2021-01-17 23:51:47 +00:00
variables :
2021-06-12 14:21:44 +00:00
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"
2021-01-17 23:51:47 +00:00
package_release_windows :
extends : .package_windows_x64
rules :
2021-12-09 13:44:56 +00:00
- if : $CI_COMMIT_REF_SLUG == "release"
when : always
2021-01-17 23:51:47 +00:00
variables :
2021-06-12 14:21:44 +00:00
CI_HAWK_ARTIFACT_NAME : "BizHawk-VERSIONHERE-win-x64"
2021-01-17 23:51:47 +00:00
2020-05-05 05:46:55 +00:00
run_tests :
artifacts :
paths :
2021-12-09 13:44:56 +00:00
- test_output/*.coverage.xml
2020-05-05 05:46:55 +00:00
reports :
junit :
2021-12-09 13:44:56 +00:00
- test_output/*.coverage.xml
2021-12-02 21:53:24 +00:00
image : mcr.microsoft.com/dotnet/sdk:6.0
2020-10-10 19:24:46 +00:00
needs :
2021-12-09 13:47:36 +00:00
- job : build_asms_release
2021-12-09 13:44:56 +00:00
artifacts : false
2020-05-05 05:46:55 +00:00
script :
2022-08-10 09:37:31 +00:00
- Dist/BuildDebug.sh # populate output
2023-12-22 03:20:19 +00:00
- Dist/BuildTestRelease.sh -v normal
2020-05-05 05:46:55 +00:00
stage : test
2021-12-09 13:44:56 +00:00
.disabled_job_sast :
variables :
SAST_EXCLUDED_ANALYZERS : bandit, brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan, phpcs-security-audit, pmd-apex, sobelow, spotbugs
stage : test
2021-03-04 10:34:11 +00:00
2021-12-09 13:44:56 +00:00
.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