-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
130 lines (118 loc) · 5.9 KB
/
azure-pipelines.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
trigger:
branches:
include:
- main
variables:
GNS_REPOSITORY_URL: https://github.com/ValveSoftware/GameNetworkingSockets.git
GNS_PATCH_SET: 1.4.1
GNS_COMMIT_HASH: 1e724c3248eefd0f49003ce2843140495e2cb475
jobs:
- job: build_windows
pool:
vmImage: 'windows-2022'
strategy:
matrix:
x64_openssl_dynamic_deps:
matrixName: x64_openssl_dynamic_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=OpenSSL -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release
CMAKE_PLATFORM: x64
MSBUILD_PLATFORM: x64
x64_libsodium_dynamic_deps:
matrixName: x64_libsodium_dynamic_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=libsodium -DVCPKG_MANIFEST_FEATURES=libsodium -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release
CMAKE_PLATFORM: x64
MSBUILD_PLATFORM: x64
x86_openssl_dynamic_deps:
matrixName: x86_openssl_dynamic_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=OpenSSL -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x86-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release
CMAKE_PLATFORM: win32
MSBUILD_PLATFORM: win32
x86_libsodium_dynamic_deps:
matrixName: x86_libsodium_dynamic_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=libsodium -DVCPKG_MANIFEST_FEATURES=libsodium -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x86-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release
CMAKE_PLATFORM: win32
MSBUILD_PLATFORM: win32
x64_openssl_static_deps:
matrixName: x64_openssl_static_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=OpenSSL -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x64-windows-static-deps-md-release -DVCPKG_HOST_TRIPLET=x64-windows-release -DProtobuf_USE_STATIC_LIBS=ON
CMAKE_PLATFORM: x64
MSBUILD_PLATFORM: x64
x64_libsodium_static_deps:
matrixName: x64_libsodium_static_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=libsodium -DVCPKG_MANIFEST_FEATURES=libsodium -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x64-windows-static-deps-md-release -DVCPKG_HOST_TRIPLET=x64-windows-release -DProtobuf_USE_STATIC_LIBS=ON
CMAKE_PLATFORM: x64
MSBUILD_PLATFORM: x64
x86_openssl_static_deps:
matrixName: x86_openssl_static_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=OpenSSL -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x86-windows-static-deps-md-release -DVCPKG_HOST_TRIPLET=x64-windows-release -DProtobuf_USE_STATIC_LIBS=ON
CMAKE_PLATFORM: win32
MSBUILD_PLATFORM: win32
x86_libsodium_static_deps:
matrixName: x86_libsodium_static_deps
CMAKE_ADDITIONAL_PARAMETERS: -DUSE_CRYPTO=libsodium -DVCPKG_MANIFEST_FEATURES=libsodium -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_OVERLAY_TRIPLETS=$(Agent.BuildDirectory)\Source\triplets -DVCPKG_TARGET_TRIPLET=x86-windows-static-deps-md-release -DVCPKG_HOST_TRIPLET=x64-windows-release -DProtobuf_USE_STATIC_LIBS=ON
CMAKE_PLATFORM: win32
MSBUILD_PLATFORM: win32
variables:
CMAKE_GENERATOR: Visual Studio 17 2022
steps:
- task: CmdLine@2
displayName: "Create directory structure"
inputs:
script: |
mkdir Source
mkdir Build
workingDirectory: $(Agent.BuildDirectory)
failOnStderr: true
- task: CmdLine@2
displayName: "Shallow clone GNS"
inputs:
script: |
git init
git remote add origin $(GNS_REPOSITORY_URL)
git fetch --depth 1 origin $(GNS_COMMIT_HASH)
git config --local advice.detachedHead false
git checkout FETCH_HEAD
git submodule update --init --depth 1
workingDirectory: $(Agent.BuildDirectory)\Source
failOnStderr: false
- task: CmdLine@2
displayName: "Apply patches"
inputs:
script: |
git apply $(Build.SourcesDirectory)\Patches\$(GNS_PATCH_SET)\Patch001.patch
git apply $(Build.SourcesDirectory)\Patches\$(GNS_PATCH_SET)\Patch002.patch
git apply $(Build.SourcesDirectory)\Patches\$(GNS_PATCH_SET)\Patch003.patch
git apply --whitespace=nowarn $(Build.SourcesDirectory)\Patches\$(GNS_PATCH_SET)\Patch004.patch
workingDirectory: $(Agent.BuildDirectory)\Source
failOnStderr: true
- task: CmdLine@2
displayName: "CMake generate solution"
inputs:
script: |
cmake -G "$(CMAKE_GENERATOR)" -A $(CMAKE_PLATFORM) -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES=Release -B Build -S Source -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_INSTALLATION_ROOT)/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC_LIB=ON -DBUILD_TESTS=ON -DENABLE_ICE=OFF -DLTO=ON $(CMAKE_ADDITIONAL_PARAMETERS)
workingDirectory: $(Agent.BuildDirectory)
failOnStderr: true
- task: MSBuild@1
inputs:
solution: '$(Agent.BuildDirectory)\Build\GameNetworkingSockets.sln'
platform: $(MSBUILD_PLATFORM)
configuration: Release
- task: CmdLine@2
displayName: "Run connection tests"
inputs:
script: |
test_connection.exe suite-quick
workingDirectory: $(Agent.BuildDirectory)\Build\bin\Release
failOnStderr: true
- task: CmdLine@2
displayName: "Run cryptography tests"
inputs:
script: |
Release\test_crypto.exe
workingDirectory: $(Agent.BuildDirectory)\Build\bin
failOnStderr: true
- task: PublishBuildArtifacts@1
displayName: "Publish artifacts"
inputs:
pathToPublish: '$(Agent.BuildDirectory)\Build\bin\Release'
artifactName: $(matrixName)