@@ -3,16 +3,13 @@ on: [push, pull_request]
3
3
4
4
jobs :
5
5
build :
6
- runs-on : windows-latest
6
+ runs-on : ${{ matrix.cfg.os }}
7
7
8
8
strategy :
9
9
matrix :
10
- arch : ["x86", "x64"]
11
- qt : ["5.15.0"]
12
-
13
- env :
14
- CMAKE_GENERATOR : Visual Studio 16 2019
15
- vcpkg-triplet : ${{ matrix.arch }}-windows-static-md
10
+ cfg :
11
+ - { os: windows-2019, generator: Visual Studio 16 2019, cmake-arch: Win32, triplet: x86-windows-static-md, qt: 5.15.0, qt-arch: win32_msvc2019 }
12
+ - { os: windows-2019, generator: Visual Studio 16 2019, cmake-arch: x64, triplet: x64-windows-static-md, qt: 5.15.0, qt_arch: win64_msvc2019_64 }
16
13
17
14
steps :
18
15
- uses : actions/checkout@v2
@@ -31,55 +28,34 @@ jobs:
31
28
with :
32
29
path : C:\vcpkg\installed
33
30
key : |
34
- vcpkg-triplet=${{ env.vcpkg- triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} vcpkg-rev=${{ steps.bootstrap-vcpkg.outputs.vcpkg-rev }}
31
+ vcpkg-triplet=${{ matrix.cfg. triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} vcpkg-rev=${{ steps.bootstrap-vcpkg.outputs.vcpkg-rev }}
35
32
restore-keys : |
36
- vcpkg-triplet=${{ env.vcpkg- triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }}
37
- vcpkg-triplet=${{ env.vcpkg- triplet }}
33
+ vcpkg-triplet=${{ matrix.cfg. triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }}
34
+ vcpkg-triplet=${{ matrix.cfg. triplet }}
38
35
39
36
- name : Upgrade Dependencies
40
37
if : steps.cache-vcpkg.outputs.cache-hit == 'true'
41
38
run : |
42
- vcpkg upgrade --no-dry-run --triplet ${{ env.vcpkg- triplet }}
39
+ vcpkg upgrade --no-dry-run --triplet ${{ matrix.cfg. triplet }}
43
40
44
41
- name : Build Dependencies
45
42
run : |
46
- vcpkg install `@vcpkg.txt --triplet ${{ env.vcpkg- triplet }}
43
+ vcpkg install `@vcpkg.txt --triplet ${{ matrix.cfg. triplet }}
47
44
vcpkg list --x-full-desc
48
45
49
- - name : Configure Platform Arch
50
- run : |
51
- # Qt started providing both x86 and x64 builds for only MSVC 2019 as of 5.15. This was
52
- # true only for MSVC 2017 before then.
53
- [int[]]$qt_ver = "${{ matrix.qt }}".split('.')
54
- if (($qt_ver[0] -eq 5) -and ($qt_ver[1] -lt 15)) {
55
- $qt_compiler = "msvc2017"
56
- } else {
57
- $qt_compiler = "msvc2019"
58
- }
59
-
60
- if ("${{ matrix.arch }}" -eq "x86") {
61
- $cmake_arch = "Win32"
62
- $qt_arch = "win32_$($qt_compiler)"
63
- } else {
64
- $cmake_arch = "${{ matrix.arch }}"
65
- $qt_arch = "win64_$($qt_compiler)_64"
66
- }
67
- Write-Host "::set-env name=CMAKE_GENERATOR_PLATFORM::$cmake_arch"
68
- Write-Host "::set-env name=QT_ARCH::$qt_arch"
69
-
70
46
# Qt5 takes roughly a thousand years to build, so we download it from elsehwere...
71
47
- name : Restore Qt Cache
72
48
id : cache-qt
73
49
uses : actions/cache@v1
74
50
with :
75
51
path : ${{ github.workspace }}\qt
76
- key : os=${{ runner.os }} qt=${{ matrix.qt }} arch=${{ env.qt_arch }}
52
+ key : os=${{ runner.os }} qt=${{ matrix.cfg. qt }} arch=${{ matrix.cfg.qt-arch }}
77
53
78
54
- name : Install Qt
79
55
uses : jurplel/install-qt-action@v2
80
56
with :
81
- arch : ${{ env.QT_ARCH }}
82
- version : ${{ matrix.qt }}
57
+ arch : ${{ matrix.cfg.qt-arch }}
58
+ version : ${{ matrix.cfg. qt }}
83
59
dir : ${{ github.workspace }}\qt
84
60
cached : ${{ steps.cache-qt.outputs.cache-hit }}
85
61
aqtversion : ==0.9.*
95
71
cd libhsplasma
96
72
mkdir build && cd build
97
73
cmake `
74
+ -G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" `
98
75
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
99
- -DVCPKG_TARGET_TRIPLET=${{ env.vcpkg- triplet }} `
76
+ -DVCPKG_TARGET_TRIPLET=${{ matrix.cfg. triplet }} `
100
77
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
101
78
-DENABLE_PYTHON=OFF -DENABLE_TOOLS=OFF -DENABLE_NET=ON -DENABLE_PHYSX=OFF ..
102
79
cmake --build . --config Release -j 2
106
83
run : |
107
84
mkdir build && cd build
108
85
cmake `
86
+ -G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" `
109
87
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
110
- -DVCPKG_TARGET_TRIPLET=${{ env.vcpkg- triplet }} `
88
+ -DVCPKG_TARGET_TRIPLET=${{ matrix.cfg. triplet }} `
111
89
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
112
90
..
113
91
cmake --build . --config Release -j 2
@@ -122,5 +100,5 @@ jobs:
122
100
- name : Upload Artifacts
123
101
uses : actions/upload-artifact@v2
124
102
with :
125
- name : ${{ runner.os }}-${{ matrix.arch }}-qt${{ matrix.qt }}
103
+ name : ${{ runner.os }}-${{ matrix.cfg.cmake- arch }}-qt${{ matrix.cfg.qt-arch }}
126
104
path : install\bin
0 commit comments