BizHawk/.gitlab-ci.yml

110 lines
2.8 KiB
YAML

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
- test
- package
build:
artifacts:
expire_in: "30 minutes"
name: "$CI_HAWK_TMPARTIFACT_NAME"
paths:
- 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
build_ext_tools:
allow_failure: true
image: mcr.microsoft.com/dotnet/core/sdk:3.1
needs:
- build
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; 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_linux:
artifacts:
expire_in: "1 month"
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: 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
# 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
run_tests:
artifacts:
paths:
- test_output/*.coverage.xml
reports:
junit:
- test_output/*.coverage.xml
image: mcr.microsoft.com/dotnet/core/sdk:3.1
needs:
- job: build
artifacts: false
script:
- Dist/BuildTestRelease.sh || Dist/BuildTestRelease.sh
stage: test
#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