-
Notifications
You must be signed in to change notification settings - Fork 275
/
Copy path.gitlab-ci-templates.yml
95 lines (92 loc) · 4.13 KB
/
.gitlab-ci-templates.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
.test_execution_script:
stage: ui-test
needs:
- job: build-installer-debug-x64
optional: true
- job: build-installer-release-x64
optional: true
hooks:
pre_get_sources_script:
- Get-Process | Where-Object { $_.Name -like "proton*" } | Stop-Process -Force
tags:
- e2e-tests
before_script:
- ci\test-scripts\uninstall-app.ps1
script:
- ci\test-scripts\install-the-app.ps1
- dotnet build src/Tests/ProtonVPN.UI.Tests/ProtonVPN.UI.Tests.csproj --arch x64 -o src/bin
- VSTest.Console.exe src\bin\ProtonVPN.UI.Tests.dll /Settings:ci/test-scripts/TestRun/test-run-settings.xml /TestCaseFilter:"Category=${CATEGORY}"
after_script:
- ci\test-scripts\uninstall-app.ps1
artifacts:
when: always
name: "result-ui"
paths:
- $TEST_ARTIFACT_PATH
expire_in: 1 weeks
.build-script:
stage: build
tags:
- windows-dot-net
script:
- echo "Building native dependencies..."
- nuget restore ProtonVPN.InstallActions.sln
- cmd.exe /c BuildDependencies.bat ${DEPENDENCIES}
- python ci\build-scripts\main.py add-commit-hash $env:CI_COMMIT_SHORT_SHA
- python ci\build-scripts\main.py defaultConfig
- dotnet build src\Builds\ProtonVPN.Builds.ConsoleJob\ProtonVPN.Builds.ConsoleJob.csproj
- echo "Injecting CI variables"
- src\bin\ProtonVPN.Builds.ConsoleJob.exe
- echo "Publishing ${TYPE}..."
- dotnet publish src/ProtonVPN.App/ProtonVPN.App.csproj -c ${TYPE} -r win-${PLATFORM} --self-contained -o $BUILD_PATH
- dotnet publish src/ProtonVPN.Service/ProtonVPN.Service.csproj -c ${TYPE} -r win-${PLATFORM} --self-contained -o $BUILD_PATH
- dotnet publish src/ProtonVPN.WireguardService/ProtonVPN.WireguardService.csproj -c ${TYPE} -r win-${PLATFORM} --self-contained -o $BUILD_PATH
- dotnet publish src/ProtonVPN.TlsVerify/ProtonVPN.TlsVerify.csproj -c ${TYPE} -r win-${PLATFORM} --self-contained -o $BUILD_PATH
- dotnet publish src/ProtonVPN.Launcher/ProtonVPN.Launcher.csproj -c ${TYPE} -r win-${PLATFORM} --self-contained -o $BUILD_PATH
- dotnet publish src/ProtonVPN.RestoreInternet/ProtonVPN.RestoreInternet.csproj -c ${TYPE} -r win-${PLATFORM} --self-contained -o $BUILD_PATH
- dotnet publish src/ProtonInstaller/ProtonInstaller.csproj -c ${TYPE} -r win-${PLATFORM} --self-contained -o $BUILD_PATH
- msbuild src\ProtonVPN.NativeHost\NativeHost.vcxproj /p:Configuration=Release /p:Platform=${PLATFORM}
artifacts:
expire_in: 1 day
paths:
- $BUILD_PATH
- src/ProtonVPN.NativeHost/bin/
variables:
GIT_SUBMODULE_STRATEGY: normal
.build-installer:
stage: build-installer
tags:
- windows-vpn-signer
script:
- python ci\build-scripts\main.py update-gh-list
- python ci\build-scripts\main.py app-installer $env:CI_COMMIT_SHORT_SHA ${PLATFORM}
artifacts:
paths:
- Setup/Installers/
expire_in: 4 weeks
variables:
FF_USE_FASTZIP: "true"
TRANSFER_METER_FREQUENCY: "2s"
ARTIFACT_COMPRESSION_LEVEL: "fastest"
CACHE_COMPRESSION_LEVEL: "fastest"
FASTZIP_ARCHIVER_BUFFER_SIZE: 128
.tests:
stage: test
script:
- cmd.exe /c BuildDependencies.bat bin
- dotnet build src\Builds\ProtonVPN.Builds.ConsoleJob\ProtonVPN.Builds.ConsoleJob.csproj
- echo "Injecting CI variables"
- src\bin\ProtonVPN.Builds.ConsoleJob.exe
- dotnet restore ProtonVpn.sln
- dotnet build ProtonVpn.sln
- coverlet src\bin --target "dotnet" --targetargs "test ProtonVpn.sln -l ""console;verbosity=normal"" --filter ""TestCategory!=UI&TestCategory!=Connection&TestCategory!=Performance&TestCategory!=BTI"" --no-restore --no-build" --format cobertura --output .\coverage-reports --exclude "[*.Tests*]*" --exclude "[ProtonVPN.MarkupValidator]*" --exclude "[TestTools*]*" --exclude "[*.Installers]*"
- powershell -Command "(gc coverage-reports.cobertura.xml) -replace '\\', '/' | Out-File -encoding UTF8 cobertura.xml"
- ReportGenerator.exe "-reports:cobertura.xml" "-targetdir:.\code-coverage-report-html"
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: cobertura.xml
coverage: '/Total.*?([0-9]{1,3}.[0-9]{1,3})%/'
variables:
GOSRPONLY: "true"