-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
56 lines (44 loc) · 3.07 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
# Caches NuGet packages between builds unless packages.config is changed
cache:
- packages -> **\packages.config
- '%LocalAppData%\NuGet\Cache'
- '%LocalAppData%\NuGet\v3-cache'
before_build:
- dotnet restore --verbosity m
install:
- ps: | # Sets environment variables for the eventual artifact and zip name
$env:COMM_HASH = $(git rev-parse --short HEAD)
$env:BUILD = "LeagueSandboxServer-v{0}.7z" -f $env:COMM_HASH
- git submodule update --init --recursive
# Set to previous due to build errors for copying GameServer
image: Previous Visual Studio 2019
build:
project: GameServer.sln
verbosity: minimal
test_script:
- curl -fsSL -o opencover.zip https://github.com/OpenCover/opencover/releases/download/4.7.922/opencover.4.7.922.zip
- ps: Expand-Archive opencover.zip ./opencover-bin/
- dotnet test
- .\opencover-bin\OpenCover.Console.exe -register:user -target:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\MSTest.exe" -targetargs:"/noresults /noisolation /testcontainer:"".\GameServerConsoleTests\bin\Debug\netcoreapp3.0\GameServerConsoleTests.dll" -filter:"+[GameServerConsole]* -[GameServerConsole]GameServerConsole.Properties.*" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -output:.\GameServerConsole_coverage.xml
- .\opencover-bin\OpenCover.Console.exe -register:user -target:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\MSTest.exe" -targetargs:"/noresults /noisolation /testcontainer:"".\GameServerLibTests\bin\Debug\netcoreapp3.0\GameServerLibTests.dll" -filter:"+[GameServerLib]* -[GameServerLib]GameServerLib.Properties.*" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -output:.\GameServerLib_coverage.xml
after_test:
# Runs CodeCov tests
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -f "GameServerConsole_coverage.xml"
- codecov -f "GameServerLib_coverage.xml"
# Creates and packs the artifact
- mkdir LeagueSandboxServer
- move Content LeagueSandboxServer
- move GameServerConsole\Settings LeagueSandboxServer\Settings
- ps: | # Recursively moves all contents of the debug folder to the LeagueSandboxServer folder (See https://gist.github.com/jcefoli/b77e7f2e8d5bfd005c55)
Get-ChildItem -Path "GameServerConsole\bin\Debug\netcoreapp3.0\" -Recurse | Move-Item -Destination "LeagueSandboxServer"
- ps: | # Changes the Content path in GameInfo.json.template to the base folder, should change this to something different
((Get-Content -path LeagueSandboxServer\Settings\GameInfo.json.template -Raw) -replace '../../../../Content','./Content') | Set-Content -Path LeagueSandboxServer\Settings\GameInfo.json.template
- ps: | # Automatically changes the .json.template files to .json files, allows users to immediately start the server
Get-ChildItem LeagueSandboxServer\Settings\*.template | Rename-Item -NewName { $_.Name -replace '.template', '.' }
- ps: | # Packs everything up for artifacting
7z a $env:BUILD LeagueSandboxServer\
artifacts:
- path: $(BUILD)
name: LeagueSandboxServer