More GitLab CI changes

* Revert 21a476200 ("Add timestamp update step", which was ineffective)
* Use `needs` to declare job dependency graph
* Replace Docker image for Ubuntu w/ minimal Debian image
* Add `build_ext_tools` job (scheduled pipelines only)
* Rename `package` job to `package_windows` and add `package_linux` (runs the
same script but then makes a `.tar` which becomes `.tar.zip`)
* Misc. cleanup
This commit is contained in:
YoshiRulz 2020-10-11 05:24:46 +10:00
parent 21a476200e
commit fa83861501
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 53 additions and 11 deletions

View File

@ -1,4 +1,6 @@
image: mcr.microsoft.com/dotnet/core/sdk:3.1
variables:
CI_HAWK_ARTIFACT_NAME: "BizHawk_devbuild_${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
CI_HAWK_TMPARTIFACT_NAME: "BizHawk_tempbuild_${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
stages:
- build
@ -8,32 +10,71 @@ stages:
build:
artifacts:
expire_in: "30 minutes"
name: "BizHawk_tempbuild_${CI_COMMIT_REF_SLUG}_$CI_COMMIT_SHORT_SHA"
name: "$CI_HAWK_TMPARTIFACT_NAME"
paths:
- output
- test_output
image: mcr.microsoft.com/dotnet/core/sdk:3.1
script:
- if [ "$CI_COMMIT_REF_SLUG" == "release" ]; then Dist/UpdateVersionInfoForRelease.sh; fi
- Dist/BuildRelease.sh
stage: build
check_style:
build_ext_tools:
allow_failure: true
dependencies: []
image: mcr.microsoft.com/dotnet/core/sdk:3.1
needs:
- build
rules:
- if: '$BIZHAWKBUILD_USE_ANALYZERS != null'
- 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; fi; done
stage: test
check_style:
image: mcr.microsoft.com/dotnet/core/sdk:3.1
needs:
- job: build
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 -p:MachineRunAnalyzersDuringBuild=true || Dist/BuildRelease.sh -p:MachineRunAnalyzersDuringBuild=true
stage: test
package:
package_linux:
artifacts:
expire_in: "1 month"
name: "BizHawk_devbuild_${CI_COMMIT_REF_SLUG}_$CI_COMMIT_SHORT_SHA"
name: "$CI_HAWK_ARTIFACT_NAME.tar"
paths:
- "$CI_HAWK_ARTIFACT_NAME.tar"
image: debian:buster-slim
needs:
- build
rules:
- if: '$CI_COMMIT_REF_SLUG == "master" || $CI_COMMIT_REF_SLUG == "release"'
when: always
script:
- su -c "apt-get update && apt-get -y install p7zip-full"
- Dist/Package.sh
- cd packaged_output
- tar -cf "../$CI_HAWK_ARTIFACT_NAME.tar" *
stage: package
package_windows:
artifacts:
expire_in: "1 month"
name: "$CI_HAWK_ARTIFACT_NAME"
paths:
- ./*
image: ubuntu:focal
image: debian:buster-slim
needs:
- build
rules:
- if: '$CI_COMMIT_REF_SLUG == "master" || $CI_COMMIT_REF_SLUG == "release"'
when: always
@ -54,8 +95,10 @@ run_tests:
reports:
junit:
- test_output/*.coverage.xml
dependencies: []
image: mcr.microsoft.com/dotnet/core/sdk:3.1
needs:
- job: build
artifacts: false
script:
- Dist/BuildTestRelease.sh || Dist/BuildTestRelease.sh
stage: test

View File

@ -6,5 +6,4 @@ find "output" -type f \( -wholename "output/EmuHawk.exe" -o -wholename "output/D
find "packaged_output/dll" -type f -name "*.xml" -exec rm "{}" \;
mkdir "packaged_output/Firmware"
cd "packaged_output/gamedb" && 7za a -t7z -mx9 "NesCarts.7z" "NesCarts.xml" && rm "NesCarts.xml" && cd "../.."
find "packaged_output" -type d -exec touch {} \; # no idea why, but some of the access timestamps are in the far future, and Mono crashes when enumerating the exe dir
find "packaged_output" -type f -name "*.sh" -exec chmod +x {} \; # installed with -m644 but needs to be 755