Skip to content

Commit 69ef758

Browse files
authored
Merge pull request #152 from rpavlik/azure
Azure Pipelines
2 parents 704bc1e + f6eb4e4 commit 69ef758

15 files changed

+507
-0
lines changed

.azure-pipelines/build_jobs.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
parameters:
2+
sourceDir: '$(System.DefaultWorkingDirectory)'
3+
4+
jobs:
5+
# Build the loader, API layers, and samples on Linux
6+
- job: linux_build
7+
displayName: 'Linux'
8+
strategy:
9+
matrix:
10+
xlib:
11+
buildType: RelWithDebInfo
12+
presentationBackend: xlib
13+
xcb:
14+
buildType: RelWithDebInfo
15+
presentationBackend: xcb
16+
wayland:
17+
buildType: RelWithDebInfo
18+
presentationBackend: wayland
19+
pool:
20+
vmImage: 'ubuntu-latest'
21+
container: khronosgroup/docker-images:openxr-sdk
22+
steps:
23+
# First build as debug
24+
- template: build_linux.yml
25+
parameters:
26+
sourceDir: ${{parameters.sourceDir}}
27+
buildType: Debug
28+
cmakeArgs: '-DPRESENTATION_BACKEND=$(PresentationBackend)'
29+
30+
# Then build release
31+
- template: build_linux.yml
32+
parameters:
33+
sourceDir: ${{parameters.sourceDir}}
34+
buildType: RelWithDebInfo
35+
cmakeArgs: '-DPRESENTATION_BACKEND=$(PresentationBackend)'
36+
37+
# This job computes the product of the config dimensions
38+
- job: generator
39+
steps:
40+
- task: PythonScript@0
41+
name: winmatrix
42+
inputs:
43+
scriptPath: $(System.DefaultWorkingDirectory)/.azure-pipelines/generate_windows_matrix_build.py
44+
# argument sets the variable name defined by python script
45+
arguments: winbuild
46+
47+
# Build the loader, API layers, and samples on Windows
48+
- job: windows_build
49+
dependsOn: generator
50+
displayName: 'Windows MSVC'
51+
variables:
52+
VULKAN_SDK: "$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)"
53+
pool:
54+
vmImage: 'windows-latest'
55+
# Use the json emitted by the generator job to set up this matrix
56+
strategy:
57+
matrix: $[ dependencies.generator.outputs['winmatrix.winbuild'] ]
58+
steps:
59+
- template: build_msvc.yml
60+
parameters:
61+
sourceDir: ${{parameters.sourceDir}}
62+
buildType: $(buildType)
63+
generator: "$(generator)"
64+
cmakeArgs: $(cmakeArgs) -DBUILD_ALL_EXTENSIONS=ON
65+
useVulkan: 'true'
66+
67+
- task: PublishPipelineArtifact@1
68+
displayName: Publish loader
69+
condition: and(succeeded(), eq(variables.buildType, 'RelWithDebInfo'))
70+
inputs:
71+
path: ${{parameters.sourceDir}}/install
72+
artifact: $(artifactName)
73+
74+
# Build the loader, API layers, and samples on Windows with MinGW
75+
# - job: mingw_build
76+
# displayName: 'Windows MinGW'
77+
# variables:
78+
# VULKAN_SDK: "$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)"
79+
# pool:
80+
# vmImage: 'windows-latest'
81+
# steps:
82+
# - template: build_mingw.yml
83+
# parameters:
84+
# sourceDir: ${{parameters.sourceDir}}
85+
# buildType: RelWithDebInfo
86+
# cmakeArgs: -DBUILD_ALL_EXTENSIONS=ON
87+
# useVulkan: 'true'
88+
89+
- job: combine_artifacts
90+
dependsOn: windows_build
91+
displayName: "Organize artifacts"
92+
# Only build this if we're succeeding and we're on the master branch
93+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
94+
pool:
95+
vmImage: 'windows-latest'
96+
steps:
97+
- download: current
98+
patterns: "**/*.dll"
99+
displayName: Download dynamic libraries
100+
- download: current
101+
patterns: "**/*.lib"
102+
displayName: Download static libraries and link import libraries
103+
- download: current
104+
patterns: "**/*.h"
105+
displayName: Download headers
106+
107+
- task: PythonScript@0
108+
displayName: Move artifact contents
109+
inputs:
110+
scriptPath: $(System.DefaultWorkingDirectory)/.azure-pipelines/organize_windows_artifacts.py
111+
arguments: $(Pipeline.Workspace) $(System.DefaultWorkingDirectory)/openxr_loader
112+
- task: PublishPipelineArtifact@1
113+
displayName: Publish combined artifact
114+
condition: succeeded()
115+
inputs:
116+
path: $(System.DefaultWorkingDirectory)/openxr_loader
117+
artifact: openxr_loader_windows

.azure-pipelines/build_linux.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
parameters:
2+
buildType: RelWithDebInfo
3+
cmakeArgs: ''
4+
buildDir: build
5+
sourceDir: '$(System.DefaultWorkingDirectory)'
6+
7+
steps:
8+
- script: |
9+
rm -rf ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
10+
mkdir -p ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
11+
displayName: 'Clean up and create new build directory'
12+
13+
- script: cmake -G Ninja .. -DCMAKE_BUILD_TYPE=${{ parameters.buildType }} ${{ parameters.cmakeArgs }}
14+
workingDirectory: ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
15+
displayName: 'Generate build system'
16+
17+
- script: ninja
18+
workingDirectory: ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
19+
displayName: 'Compile'

.azure-pipelines/build_mingw.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
parameters:
2+
buildType: 'Debug'
3+
cmakeArgs: ''
4+
sourceDir: '$(System.DefaultWorkingDirectory)'
5+
useVulkan: 'true'
6+
7+
steps:
8+
# - script: choco install -y ninja
9+
# displayName: 'Install Ninja'
10+
11+
- script: mkdir $(System.DefaultWorkingDirectory)\\vulkan_sdk
12+
displayName: 'Make Vulkan SDK dir'
13+
14+
- powershell: ./.azure-pipelines/install_vulkan.ps1
15+
displayName: Install Vulkan SDK
16+
workingDirectory: '${{ parameters.sourceDir }}'
17+
condition: eq('${{ parameters.useVulkan}}', 'true')
18+
19+
- script: mkdir build
20+
displayName: 'Create build directory'
21+
workingDirectory: '${{ parameters.sourceDir }}'
22+
23+
- script: |
24+
set VULKAN_SDK=$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)
25+
cmake .. -G "MinGW Makefiles" ${{ parameters.cmakeArgs }} -DCMAKE_BUILD_TYPE=${{ parameters.buildType }} -DCMAKE_INSTALL_PREFIX=${{ parameters.sourceDir }}/install
26+
displayName: 'Generate build system'
27+
workingDirectory: '${{ parameters.sourceDir }}/build'
28+
29+
- script: mingw32-make -C build -j
30+
displayName: Build all targets
31+
32+
- script: mingw32-make -C build install
33+
displayName: Install build

.azure-pipelines/build_msvc.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
parameters:
2+
buildType: 'Debug'
3+
generator: 'Visual Studio 16 2019'
4+
cmakeArgs: ''
5+
sourceDir: '$(System.DefaultWorkingDirectory)'
6+
useVulkan: 'true'
7+
8+
steps:
9+
10+
- powershell: ./.azure-pipelines/install_vulkan.ps1
11+
displayName: Install Vulkan SDK
12+
workingDirectory: '${{ parameters.sourceDir }}'
13+
condition: eq('${{ parameters.useVulkan}}', 'true')
14+
15+
- script: mkdir build
16+
displayName: 'Create build directory'
17+
workingDirectory: '${{ parameters.sourceDir }}'
18+
19+
- script: |
20+
set VULKAN_SDK=$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)
21+
cmake .. -G "${{ parameters.generator }}" ${{ parameters.cmakeArgs }} -DCMAKE_INSTALL_PREFIX=${{ parameters.sourceDir }}/install
22+
displayName: 'Generate build system'
23+
workingDirectory: '${{ parameters.sourceDir }}/build'
24+
25+
- task: MSBuild@1
26+
displayName: Build all targets
27+
inputs:
28+
solution: '${{ parameters.sourceDir }}/build/ALL_BUILD.vcxproj'
29+
maximumCpuCount: true
30+
configuration: ${{ parameters.buildType }}
31+
32+
- task: MSBuild@1
33+
displayName: Install build
34+
inputs:
35+
solution: '${{ parameters.sourceDir }}/build/INSTALL.vcxproj'
36+
maximumCpuCount: true
37+
configuration: ${{ parameters.buildType }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
jobs:
3+
- job: check_clang_format
4+
displayName: 'clang-format'
5+
pool:
6+
vmImage: 'ubuntu-16.04'
7+
container: khronosgroup/docker-images:openxr-sdk
8+
steps:
9+
- script: ./runClangFormat.sh
10+
displayName: Run clang-format
11+
12+
- script: git diff --patch --exit-code > clang-format.patch
13+
displayName: Save changes as diff
14+
15+
# In case of failure (clang-format changes needed) do these two things
16+
- script: echo "The following files need clang-formatting:"; sed -n -e "s/^diff.* b\///p" clang-format.patch
17+
condition: failed()
18+
- task: PublishPipelineArtifact@1
19+
displayName: Publish diff
20+
condition: failed()
21+
inputs:
22+
path: $(System.DefaultWorkingDirectory)/clang-format.patch
23+
artifact: clang-format-changes

.azure-pipelines/codespell.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
jobs:
3+
- job: check_codespell
4+
displayName: 'codespell'
5+
pool:
6+
vmImage: 'ubuntu-16.04'
7+
container: khronosgroup/docker-images:openxr-sdk
8+
steps:
9+
- script: ./checkCodespell
10+
displayName: Run Codespell script
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env python3
2+
# Copyright (c) 2019 The Khronos Group Inc.
3+
4+
from itertools import product
5+
6+
from shared import (BITS, TRUE_FALSE, VS_VERSIONS, make_win_artifact_name,
7+
output_json)
8+
9+
if __name__ == "__main__":
10+
11+
configs = {}
12+
for vsver, bits, debug, dynamic in product(VS_VERSIONS.keys(), BITS, (False,), TRUE_FALSE):
13+
label = [str(vsver)]
14+
config = []
15+
generator = VS_VERSIONS[vsver]
16+
if bits == 64:
17+
config.append('-A x64')
18+
else:
19+
config.append('-A Win32')
20+
label.append(str(bits))
21+
if dynamic:
22+
label.append('dynamic')
23+
config.append('-DDYNAMIC_LOADER=ON')
24+
else:
25+
label.append('static')
26+
config.append('-DDYNAMIC_LOADER=OFF')
27+
if debug:
28+
label.append('debug')
29+
name = '_'.join(label)
30+
configs[name] = {
31+
'generator': generator,
32+
'buildType': 'Debug' if debug else 'RelWithDebInfo',
33+
'cmakeArgs': ' '.join(config),
34+
'dynamic': dynamic,
35+
'bits': bits
36+
}
37+
if not debug:
38+
configs[name]['artifactName'] = make_win_artifact_name(
39+
vsver, dynamic, bits)
40+
41+
output_json(configs)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
if (-not $env:VULKAN_SDK_VERSION) {
2+
$env:VULKAN_SDK_VERSION = "1.1.114.0"
3+
}
4+
5+
$SDK_VER = $env:VULKAN_SDK_VERSION
6+
7+
if (-not (Test-Path env:VULKAN_SDK)) {
8+
if ($env:SYSTEM_DEFAULTWORKINGDIRECTORY) {
9+
$env:VULKAN_SDK = "$env:SYSTEM_DEFAULTWORKINGDIRECTORY\vulkan_sdk\$SDK_VER"
10+
} else {
11+
$env:VULKAN_SDK = "c:\VulkanSDK\$SDK_VER"
12+
}
13+
}
14+
$parent = Split-Path -path $env:VULKAN_SDK
15+
Write-Output "Trying for Vulkan SDK $SDK_VER"
16+
$FN = "vksdk-$SDK_VER-lite.7z"
17+
$URL = "https://people.collabora.com/~rpavlik/ci_resources/$FN"
18+
if (-not (Test-Path "$env:VULKAN_SDK/Include/vulkan/vulkan.h")) {
19+
Write-Output "Downloading $URL"
20+
$wc = New-Object System.Net.WebClient
21+
$wc.DownloadFile($URL, "$(pwd)\$FN")
22+
23+
Write-Output "Extracting $FN in silent, blocking mode to $env:VULKAN_SDK"
24+
Start-Process "c:\Program Files\7-Zip\7z" -ArgumentList "x", $FN, "-o$parent" -Wait
25+
} else {
26+
Write-Output "$env:VULKAN_SDK found and contains header"
27+
}

0 commit comments

Comments
 (0)