forked from endless-sky/endless-sky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
101 lines (88 loc) · 3.92 KB
/
.appveyor.yml
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
version: '{branch}.{build}'
skip_tags: true
skip_branch_with_pr: true
clone_depth: 2
environment:
TEST_REPORT_FILE: .\tests\test-report.xml
PYTHON_BINARY: C:/Python38-x64/python.exe
SCCACHE_DIR: sccache
CXX: sccache g++
es_run_mode: 'dist'
matrix:
- MINGW_ROOT: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64
MINGW_VERSION: v6.3.0
- MINGW_ROOT: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64
MINGW_VERSION: v7.3.0
- MINGW_ROOT: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
MINGW_VERSION: v8.1.0
install:
# Update env variables to use the desired MinGW version
- ps: |
Set-AppveyorBuildVariable -Name PATH -Value "$Env:MINGW_ROOT\bin\;$Env:PATH";
Set-AppveyorBuildVariable -Name DIR_MINGW64 -Value "$Env:MINGW_ROOT\x86_64-w64-mingw32";
# Ensure we have the precompiled libraries to link with (SDL, etc.).
- ps: |
if (!(Test-Path 'C:\dev64')) { New-Item 'C:\dev64' -ItemType Directory; }
if (!(Test-Path 'C:\dev64\bin'))
{
Start-FileDownload 'http://endless-sky.github.io/win64-dev.zip' 'C:\dev64.zip'
$zipArgs = 'x C:\dev64.zip -oC:\';
Start-Process '7z.exe' -ArgumentList $zipArgs -Wait;
}
# Enable warning-free threaded python builds (and don't fail because pip is outdated).
- ps: |
$originalSetting = $ErrorActionPreference;
$ErrorActionPreference = 'SilentlyContinue';
C:/Python38-x64/python.exe -m pip install pywin32 2> $null;
$ErrorActionPreference = $originalSetting;
# Use sccache
- ps: choco install sccache
cache:
- C:\dev64
- C:\ProgramData\chocolatey\bin
- C:\ProgramData\chocolatey\lib
- scons-local -> .winmake
- sccache -> .winmake
- .sconsign.dblite -> .winmake
build_script:
- ps: mingw32-make.exe -re -j2 -f .winmake $Env:es_run_mode;
before_test:
- ps: mingw32-make.exe -re -j2 -f .winmake build-tests;
- ps: |
$here = (Get-Location).Path;
Copy-Item -Path "bin\pkgd\release\endless-sky.exe" -Destination $here;
Copy-Item -Path "C:\dev64\bin\*.dll" -Exclude "libstdc*" -Destination $here;
test_script:
- ps: .\tests\endless-sky-tests.exe -n es-ci -i --warn NoAssertions --order rand --rng-seed 'time' --filenames-as-tags -r junit -o $Env:TEST_REPORT_FILE;
- ps: .\tests\test_parse.ps1 'endless-sky.exe';
# Upload the build if tests passed.
after_test:
- ps: |
$here = (Get-Location).Path;
Copy-Item -Path "$Env:DIR_MINGW64\lib\libstdc++-6.dll" -Destination $here;
Copy-Item -Path "$Env:DIR_MINGW64\lib\libgcc_s_seh-1.dll" -Destination $here;
Copy-Item -Path "$Env:DIR_MINGW64\lib\libwinpthread-1.dll" -Destination $here;
# Zip the directory for release
$BRANCH_NAME = switch ( [string]::IsNullOrEmpty($Env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) ) {
$true { $Env:APPVEYOR_REPO_BRANCH }
$false { $Env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH }
};
$REPO_NAME = $Env:APPVEYOR_REPO_NAME -replace "^.+/";
$ARCHIVE_NAME = "$REPO_NAME-$BRANCH_NAME-$($Env:APPVEYOR_REPO_COMMIT.SubString(0,7))-MinGW$Env:MINGW_VERSION-win64.7z";
# Remove invalid characters that would prevent saving the artifact.
$INVALID_CHARS = [IO.Path]::GetInvalidFileNameChars() -join '';
$REPLACER = "[{0}]" -f [RegEx]::Escape($INVALID_CHARS);
$ARCHIVE_NAME = ($ARCHIVE_NAME -replace $REPLACER)
$ZIP_ARGS = "a $ARCHIVE_NAME .\*.exe -i!.\*.dll -i!.\data\ -i!.\icons\ -i!.\images\ -i!.\sounds\ -i!.\source\ -i!license.txt -i!copyright -i!README.md -i!changelog -i!credits.txt -i!keys.txt";
Start-Process '7z.exe' -ArgumentList $ZIP_ARGS -Wait;
Push-AppveyorArtifact $ARCHIVE_NAME;
# Upload the test report even if tests failed.
on_finish:
- ps: |
if (Test-Path $Env:TEST_REPORT_FILE)
{
(New-Object 'System.Net.WebClient').UploadFile(
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
(Resolve-Path $Env:TEST_REPORT_FILE)
);
}