mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Fix AppVeyor for testing
This commit is contained in:
@@ -19,16 +19,11 @@ install:
|
||||
platform:
|
||||
- Win32
|
||||
- x64
|
||||
configuration:
|
||||
- Release
|
||||
- ReleaseTests
|
||||
configuration: Release
|
||||
build:
|
||||
project: openrct2.proj
|
||||
test_script:
|
||||
- ps: >-
|
||||
if ($env:configuration -eq "ReleaseTests") {
|
||||
msbuild openrct2.proj /t:test /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
}
|
||||
- ps: msbuild openrct2.proj /t:test /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
artifacts:
|
||||
- path: .\artifacts\openrct2-portable*.zip
|
||||
name: OpenRCT2-portable
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
|
||||
<Platform Condition="'$(PLATFORM)'==''">x64</Platform>
|
||||
<TestConfig Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">true</TestConfig>
|
||||
<GIT_COMMIT_SHA1_SHORT Condition="'$(GIT_COMMIT_SHA1)'!=''">$(GIT_COMMIT_SHA1.Substring(0, 7))</GIT_COMMIT_SHA1_SHORT>
|
||||
|
||||
<Version>0.0.5.0</Version>
|
||||
@@ -213,7 +214,8 @@
|
||||
</Target>
|
||||
|
||||
<!-- Target to build g2.dat containing OpenRCT2 sprites -->
|
||||
<Target Name="g2" DependsOnTargets="Build" AfterTargets="Build" Inputs="@(g2Inputs)" Outputs="$(g2Output)">
|
||||
<Target Name="g2" DependsOnTargets="Build" AfterTargets="Build" Inputs="@(g2Inputs)" Outputs="$(g2Output)"
|
||||
Condition="'$(TestConfig)'!='true'">
|
||||
<Message Text="Building g2.dat..." />
|
||||
<Exec Command="$(OutputExe) sprite build $(g2Output) $(RootDir)resources\g2"
|
||||
StandardOutputImportance="low" />
|
||||
@@ -221,7 +223,8 @@
|
||||
|
||||
<!-- Target to sign OpenRCT2
|
||||
This requires the project parameter SIGN_PASSWORD to be set -->
|
||||
<Target Name="Sign" AfterTargets="Build" Inputs="@(SignItems)" Outputs="%(SignItems.Identity).signed">
|
||||
<Target Name="Sign" AfterTargets="Build" Inputs="@(SignItems)" Outputs="%(SignItems.Identity).signed"
|
||||
Condition="'$(TestConfig)'!='true'">
|
||||
<Warning Condition="'$(SIGN_PASSWORD)'==''" Text="SIGN_PASSWORD was not set, skipping signing of %(SignItems.Filename)%(SignItems.Extension)." />
|
||||
<Message Condition="'$(SIGN_PASSWORD)'!=''" Text="Signing %(SignItems.Filename)%(SignItems.Extension)"
|
||||
Importance="high" />
|
||||
@@ -234,14 +237,16 @@
|
||||
</Target>
|
||||
|
||||
<!-- Target to publish OpenRCT2 as a portable zip -->
|
||||
<Target Name="PublishPortable" DependsOnTargets="Build;g2" Inputs="@(PublishItems)" Outputs="$(PublishZip)">
|
||||
<Target Name="PublishPortable" DependsOnTargets="Build;g2" Inputs="@(PublishItems)" Outputs="$(PublishZip)"
|
||||
Condition="'$(TestConfig)'!='true'">
|
||||
<MakeDir Directories="$(ArtifactsDir)" />
|
||||
<Message Importance="high" Text="Creating $([System.IO.Path]::GetFileName($(PublishZip)))..." />
|
||||
<_7z Output="$(PublishZip)" Inputs="@(PublishItems)" />
|
||||
</Target>
|
||||
|
||||
<!-- Target to publish the OpenRCT2 debug symbols -->
|
||||
<Target Name="PublishSymbols" DependsOnTargets="Build" Inputs="@(SymbolItems)" Outputs="$(PublishSymbolsZip)">
|
||||
<Target Name="PublishSymbols" DependsOnTargets="Build" Inputs="@(SymbolItems)" Outputs="$(PublishSymbolsZip)"
|
||||
Condition="'$(TestConfig)'!='true'">
|
||||
<MakeDir Directories="$(ArtifactsDir)" />
|
||||
<Message Importance="high" Text="Creating $([System.IO.Path]::GetFileName($(PublishSymbolsZip)))..." />
|
||||
<_7z Output="$(PublishSymbolsZip)" Inputs="@(SymbolItems)" />
|
||||
@@ -252,7 +257,7 @@
|
||||
DependsOnTargets="Build;g2"
|
||||
Inputs="@(PublishItems);$(NsisScript)"
|
||||
Outputs="$(PublishInstallerExe)"
|
||||
Condition="'$(NO_NSIS)'!='true'">
|
||||
Condition="'$(NO_NSIS)'!='true' AND '$(TestConfig)'!='true'">
|
||||
<PropertyGroup>
|
||||
<PublishInstallerExeName>$([System.IO.Path]::GetFilename($(PublishInstallerExe)))</PublishInstallerExeName>
|
||||
</PropertyGroup>
|
||||
@@ -280,7 +285,8 @@
|
||||
DependsOnTargets="PublishSymbols;PublishPortable;PublishInstaller" />
|
||||
|
||||
<!-- Target to upload the artifacts to OpenRCT2.org -->
|
||||
<Target Name="UploadArtifacts" DependsOnTargets="PublishAll">
|
||||
<Target Name="UploadArtifacts" DependsOnTargets="PublishAll"
|
||||
Condition="'$(TestConfig)'!='true'">
|
||||
<PropertyGroup>
|
||||
<UploadLink>https://openrct2.org/altapi/?command=push-build</UploadLink>
|
||||
<UploadFileNameShort>%(UploadArtifacts.Filename)%(UploadArtifacts.Extension)</UploadFileNameShort>
|
||||
|
||||
@@ -2,20 +2,24 @@
|
||||
# Script to deploy OpenRCT2 from AppVeyor #
|
||||
###########################################
|
||||
|
||||
# Check if OpenRCT2.org API security token is available
|
||||
if (${env:OPENRCT2_ORG_TOKEN})
|
||||
$testing = (${env:Configuration} -like "*tests")
|
||||
if (-not $testing)
|
||||
{
|
||||
# Only upload tagged builds, develop branch or push/ branches
|
||||
if (${env:APPVEYOR_REPO_TAG} -eq "true" -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/")
|
||||
# Check if OpenRCT2.org API security token is available
|
||||
if (${env:OPENRCT2_ORG_TOKEN})
|
||||
{
|
||||
msbuild openrct2.proj /t:UploadArtifacts /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
# Only upload tagged builds, develop branch or push/ branches
|
||||
if (${env:APPVEYOR_REPO_TAG} -eq "true" -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/")
|
||||
{
|
||||
msbuild openrct2.proj /t:UploadArtifacts /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "No deployment: Non-tagged or push branch." -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "No deployment: Non-tagged or push branch." -ForegroundColor Yellow
|
||||
Write-Host "No deployment: %OPENRCT2_ORG_TOKEN% not available." -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "No deployment: %OPENRCT2_ORG_TOKEN% not available." -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
# Script to setup OpenRCT2 for building on AppVeyor
|
||||
#########################################################
|
||||
|
||||
$testing = (${env:Configuration} -like "*tests")
|
||||
|
||||
function Check-ExitCode
|
||||
{
|
||||
if ($LASTEXITCODE -ne 0)
|
||||
@@ -10,7 +12,7 @@ function Check-ExitCode
|
||||
}
|
||||
}
|
||||
|
||||
if ($env:ENCKEY)
|
||||
if ($env:ENCKEY -and -not $testing)
|
||||
{
|
||||
if (-not (Test-Path "secure-file"))
|
||||
{
|
||||
@@ -24,7 +26,7 @@ if ($env:ENCKEY)
|
||||
}
|
||||
|
||||
# Check if OpenRCT2.org API security token is available
|
||||
if (${env:OPENRCT2_ORG_TOKEN})
|
||||
if (${env:OPENRCT2_ORG_TOKEN} -and -not $testing)
|
||||
{
|
||||
if (-not (Test-Path "C:\ProgramData\chocolatey\lib\nsis.portable"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user