-
-
Notifications
You must be signed in to change notification settings - Fork 21
86 lines (74 loc) · 2.52 KB
/
ci-windows.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
name: Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
windows-test-build-release:
runs-on: windows-latest
steps:
- name: Setup
uses: compnerd/[email protected]
with:
branch: swift-5.10-release
tag: 5.10-RELEASE
- name: Checkout
uses: actions/[email protected]
- name: Cache vcpkg
uses: actions/[email protected]
with:
key: windows-x64-vcpkg
path: C:\vcpkg\installed\x64-windows
- name: Build & Test
shell: pwsh
run: |
vcpkg integrate powershell
# install dependencies
vcpkg install sdl2[core,vulkan] --recurse --triplet x64-windows --no-print-usage
vcpkg install pkgconf --triplet x64-windows --no-print-usage
# setup pkgconf environment
$env:Path += ";C:\vcpkg\installed\x64-windows\tools\pkgconf\"
$env:PKG_CONFIG_PATH = "C:\vcpkg\installed\x64-windows\lib\pkgconfig\"
# generate windows header
$includedir = (pkgconf --variable includedir sdl2).Trim()
Write-Output ('#include "' + $includedir + '/SDL2/SDL.h"') > Sources/CSDL2/windows_generated.h
Write-Output ('#include "' + $includedir + '/SDL2/SDL_vulkan.h"') >> Sources/CSDL2/windows_generated.h
# build
swift build
# copy SDL libraries
$bindir = ((pkgconf --variable exec_prefix sdl2).Trim() + "/bin")
$libdir = (pkgconf --variable libdir sdl2).Trim()
foreach ($config in "debug", "release") {
$path = ".build/$config"
if (Test-Path -Path $path) {
Copy-Item ($bindir + '/SDL2.dll') $path
Copy-Item ($libdir + '/SDL2.lib') $path
}
}
# test
swift test
- name: Upload artifacts
if: always()
uses: actions/[email protected]
with:
name: test-artifacts-windows-${{ github.run_id }}
path: |
.build/*.yaml
.build/*.xml
.build/*.json
.build/*.txt
.build/**/*.json
.build/**/*.txt
.build/**/*.a
.build/**/*.lib
.build/**/*.pdb
.build/**/*.dSYM
.build/**/*.gdb
.build/**/*.xctest
.build/**/*.bundle
.build/**/MetalApp
.build/**/Minimal
if-no-files-found: warn
include-hidden-files: true