|
1 | 1 | version: '{branch}.{build}' |
2 | 2 |
|
3 | | -branches: |
4 | | - except: |
5 | | - - gh-pages |
| 3 | +skip_tags: true |
| 4 | +skip_branch_with_pr: true |
6 | 5 |
|
7 | | -clone_depth: 5 |
| 6 | +clone_depth: 2 |
8 | 7 |
|
9 | 8 | environment: |
10 | | - # Building with MinGW-w64 version 6.3.0. These env settings are used by the makefile. |
11 | | - MINGW_ROOT: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 |
12 | | - matrix: |
13 | | - - es_run_mode: 'dist' |
| 9 | + TEST_REPORT_FILE: .\tests\test-report.xml |
| 10 | + PYTHON_BINARY: C:/Python38-x64/python.exe |
| 11 | + SCCACHE_DIR: sccache |
| 12 | + CXX: sccache g++ |
| 13 | + AR: gcc-ar |
| 14 | + es_run_mode: 'dist' |
| 15 | + matrix: |
| 16 | + - MINGW_ROOT: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 |
| 17 | + MINGW_VERSION: v6.3.0 |
| 18 | + - MINGW_ROOT: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64 |
| 19 | + MINGW_VERSION: v7.3.0 |
| 20 | + - MINGW_ROOT: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64 |
| 21 | + MINGW_VERSION: v8.1.0 |
14 | 22 |
|
15 | 23 | install: |
16 | | - - ps: | |
17 | | - # Update env variables to use the desired MinGW version |
18 | | - Set-AppveyorBuildVariable -Name PATH -Value "$Env:MINGW_ROOT\bin\;$Env:PATH"; |
19 | | - Set-AppveyorBuildVariable -Name DIR_MINGW64 -Value "$Env:MINGW_ROOT\x86_64-w64-mingw32"; |
20 | | - # Ensure we have the precompiled libraries to link with (SDL, etc.). |
21 | | - if (!(Test-Path 'C:\dev64')) { New-Item 'C:\dev64' -ItemType Directory; } |
22 | | - if (!(Test-Path 'C:\dev64\bin')) |
23 | | - { |
24 | | - Start-FileDownload 'http://endless-sky.github.io/win64-dev.zip' 'C:\dev64.zip' |
25 | | - $zipArgs = 'x C:\dev64.zip -oC:\'; |
26 | | - Start-Process '7z.exe' -ArgumentList $zipArgs -Wait; |
27 | | - } |
28 | | - # Ensure we have instructions on how to build our executable. |
29 | | - if (!(Test-Path '.winmake')) |
30 | | - { |
31 | | - if (!(Test-Path 'C:\cbp2make')) { New-Item 'C:\cbp2make' -ItemType Directory; } |
32 | | - $cbp2make_dir = 'C:\cbp2make\cbp2make-stl-rev147-all\bin'; |
33 | | - if (!(Test-Path $cbp2make_dir)) |
34 | | - { |
35 | | - Start-FileDownload 'https://downloads.sourceforge.net/project/cbp2make/cbp2make-stl-rev147-all.tar.7z?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fcbp2make%2Ffiles%2F%3Fsource%3Dnavbar&ts=1500511318&use_mirror=managedway' 'C:\cbp2make.tar.gz'; |
36 | | - $zipArgs = 'x C:\cbp2make.tar.gz -oC:\cbp2make'; |
37 | | - Start-Process '7z.exe' -ArgumentList $zipArgs -Wait; |
38 | | - } |
39 | | - (Get-Content 'EndlessSky.cbp') -replace 'C:\\Program Files\\mingw64\\x86_64-w64-mingw32', $Env:DIR_MINGW64 | Set-Content 'EndlessSky.cbp'; |
40 | | - $makeExe = "$cbp2make_dir\Release\cbp2make.exe"; |
41 | | - $makeArg = '--local -in EndlessSky.cbp -out .winmake'; |
42 | | - Start-Process $makeExe -ArgumentList $makeArg -Wait; |
43 | | - } |
| 24 | + # Update env variables to use the desired MinGW version |
| 25 | + - ps: | |
| 26 | + Set-AppveyorBuildVariable -Name PATH -Value "$Env:MINGW_ROOT\bin\;$Env:PATH"; |
| 27 | + Set-AppveyorBuildVariable -Name DIR_MINGW64 -Value "$Env:MINGW_ROOT\x86_64-w64-mingw32"; |
| 28 | + # Ensure we have the precompiled libraries to link with (SDL, etc.). |
| 29 | + - ps: | |
| 30 | + if (!(Test-Path 'C:\dev64')) { New-Item 'C:\dev64' -ItemType Directory; } |
| 31 | + if (!(Test-Path 'C:\dev64\bin')) |
| 32 | + { |
| 33 | + Start-FileDownload 'http://endless-sky.github.io/win64-dev.zip' 'C:\dev64.zip' |
| 34 | + $zipArgs = 'x C:\dev64.zip -oC:\'; |
| 35 | + Start-Process '7z.exe' -ArgumentList $zipArgs -Wait; |
| 36 | + } |
| 37 | + # Use sccache |
| 38 | + - ps: choco install sccache |
44 | 39 |
|
45 | 40 | cache: |
46 | | - - C:\dev64 |
| 41 | + - C:\dev64 |
| 42 | + - C:\ProgramData\chocolatey\bin |
| 43 | + - C:\ProgramData\chocolatey\lib |
| 44 | + - scons-local -> .winmake |
| 45 | + - sccache -> .winmake |
| 46 | + - .sconsign.dblite -> .winmake |
47 | 47 |
|
48 | 48 | build_script: |
49 | | - - ps: mingw32-make.exe -k -j2 -e -f .winmake $Env:es_run_mode; |
| 49 | + - ps: mingw32-make.exe -re -j2 -f .winmake $Env:es_run_mode; |
50 | 50 |
|
51 | 51 | before_test: |
52 | | - - ps: | |
53 | | - $here = (Get-Location).Path; |
54 | | - Copy-Item -Path "bin\*\EndlessSky.exe" -Destination $here; |
55 | | - Copy-Item -Path "C:\dev64\bin\*.dll" -Exclude "libstdc*" -Destination $here; |
| 52 | + - ps: mingw32-make.exe -re -j2 -f .winmake build-tests; |
| 53 | + - ps: | |
| 54 | + $here = (Get-Location).Path; |
| 55 | + Copy-Item -Path "bin\pkgd\release\endless-sky.exe" -Destination $here; |
| 56 | + Copy-Item -Path "C:\dev64\bin\*.dll" -Exclude "libstdc*" -Destination $here; |
56 | 57 |
|
57 | 58 | test_script: |
58 | | - - ps: .\tests\test_parse.ps1 'EndlessSky.exe'; |
| 59 | + - 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; |
| 60 | + - ps: .\tests\test_parse.ps1 'endless-sky.exe'; |
59 | 61 |
|
| 62 | +# Upload the build if tests passed. |
60 | 63 | after_test: |
61 | | - - ps: | |
62 | | - $here = (Get-Location).Path; |
63 | | - Copy-Item -Path "$Env:DIR_MINGW64\lib\libstdc++-6.dll" -Destination $here; |
64 | | - Copy-Item -Path "$Env:DIR_MINGW64\lib\libgcc_s_seh-1.dll" -Destination $here; |
65 | | - Copy-Item -Path "$Env:DIR_MINGW64\lib\libwinpthread-1.dll" -Destination $here; |
66 | | - # Zip the directory for release |
67 | | - $ARCHIVE_NAME = "$Env:APPVEYOR_REPO_NAME-$Env:APPVEYOR_REPO_BRANCH-$Env:APPVEYOR_REPO_COMMIT-win64.7z"; |
68 | | - $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"; |
69 | | - Start-Process '7z.exe' -ArgumentList $ZIP_ARGS -Wait; |
70 | | - Push-AppveyorArtifact $ARCHIVE_NAME; |
| 64 | + - ps: | |
| 65 | + $here = (Get-Location).Path; |
| 66 | + Copy-Item -Path "$Env:DIR_MINGW64\lib\libstdc++-6.dll" -Destination $here; |
| 67 | + Copy-Item -Path "$Env:DIR_MINGW64\lib\libgcc_s_seh-1.dll" -Destination $here; |
| 68 | + Copy-Item -Path "$Env:DIR_MINGW64\lib\libwinpthread-1.dll" -Destination $here; |
| 69 | +
|
| 70 | + # Zip the directory for release |
| 71 | + $BRANCH_NAME = switch ( [string]::IsNullOrEmpty($Env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) ) { |
| 72 | + $true { $Env:APPVEYOR_REPO_BRANCH } |
| 73 | + $false { $Env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH } |
| 74 | + }; |
| 75 | + $REPO_NAME = $Env:APPVEYOR_REPO_NAME -replace "^.+/"; |
| 76 | + $ARCHIVE_NAME = "$REPO_NAME-$BRANCH_NAME-$($Env:APPVEYOR_REPO_COMMIT.SubString(0,7))-MinGW$Env:MINGW_VERSION-win64.7z"; |
| 77 | +
|
| 78 | + # Remove invalid characters that would prevent saving the artifact. |
| 79 | + $INVALID_CHARS = [IO.Path]::GetInvalidFileNameChars() -join ''; |
| 80 | + $REPLACER = "[{0}]" -f [RegEx]::Escape($INVALID_CHARS); |
| 81 | + $ARCHIVE_NAME = ($ARCHIVE_NAME -replace $REPLACER) |
| 82 | +
|
| 83 | + $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"; |
| 84 | + Start-Process '7z.exe' -ArgumentList $ZIP_ARGS -Wait; |
| 85 | + Push-AppveyorArtifact $ARCHIVE_NAME; |
| 86 | +
|
| 87 | +# Upload the test report even if tests failed. |
| 88 | +on_finish: |
| 89 | + - ps: | |
| 90 | + if (Test-Path $Env:TEST_REPORT_FILE) |
| 91 | + { |
| 92 | + (New-Object 'System.Net.WebClient').UploadFile( |
| 93 | + "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", |
| 94 | + (Resolve-Path $Env:TEST_REPORT_FILE) |
| 95 | + ); |
| 96 | + } |
0 commit comments