Skip to content

Commit 1db8baa

Browse files
committed
Remove deprecated ::set-env command usage.
1 parent f83b32e commit 1db8baa

File tree

1 file changed

+17
-39
lines changed

1 file changed

+17
-39
lines changed

.github/workflows/windows-ci.yml

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ on: [push, pull_request]
33

44
jobs:
55
build:
6-
runs-on: windows-latest
6+
runs-on: ${{ matrix.cfg.os }}
77

88
strategy:
99
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 }
1613

1714
steps:
1815
- uses: actions/checkout@v2
@@ -31,55 +28,34 @@ jobs:
3128
with:
3229
path: C:\vcpkg\installed
3330
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 }}
3532
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 }}
3835
3936
- name: Upgrade Dependencies
4037
if: steps.cache-vcpkg.outputs.cache-hit == 'true'
4138
run: |
42-
vcpkg upgrade --no-dry-run --triplet ${{ env.vcpkg-triplet }}
39+
vcpkg upgrade --no-dry-run --triplet ${{ matrix.cfg.triplet }}
4340
4441
- name: Build Dependencies
4542
run: |
46-
vcpkg install `@vcpkg.txt --triplet ${{ env.vcpkg-triplet }}
43+
vcpkg install `@vcpkg.txt --triplet ${{ matrix.cfg.triplet }}
4744
vcpkg list --x-full-desc
4845
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-
7046
# Qt5 takes roughly a thousand years to build, so we download it from elsehwere...
7147
- name: Restore Qt Cache
7248
id: cache-qt
7349
uses: actions/cache@v1
7450
with:
7551
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 }}
7753

7854
- name: Install Qt
7955
uses: jurplel/install-qt-action@v2
8056
with:
81-
arch: ${{ env.QT_ARCH }}
82-
version: ${{ matrix.qt }}
57+
arch: ${{ matrix.cfg.qt-arch }}
58+
version: ${{ matrix.cfg.qt }}
8359
dir: ${{ github.workspace }}\qt
8460
cached: ${{ steps.cache-qt.outputs.cache-hit }}
8561
aqtversion: ==0.9.*
@@ -95,8 +71,9 @@ jobs:
9571
cd libhsplasma
9672
mkdir build && cd build
9773
cmake `
74+
-G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" `
9875
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
99-
-DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} `
76+
-DVCPKG_TARGET_TRIPLET=${{ matrix.cfg.triplet }} `
10077
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
10178
-DENABLE_PYTHON=OFF -DENABLE_TOOLS=OFF -DENABLE_NET=ON -DENABLE_PHYSX=OFF ..
10279
cmake --build . --config Release -j 2
@@ -106,8 +83,9 @@ jobs:
10683
run: |
10784
mkdir build && cd build
10885
cmake `
86+
-G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" `
10987
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
110-
-DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} `
88+
-DVCPKG_TARGET_TRIPLET=${{ matrix.cfg.triplet }} `
11189
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
11290
..
11391
cmake --build . --config Release -j 2
@@ -122,5 +100,5 @@ jobs:
122100
- name: Upload Artifacts
123101
uses: actions/upload-artifact@v2
124102
with:
125-
name: ${{ runner.os }}-${{ matrix.arch }}-qt${{ matrix.qt }}
103+
name: ${{ runner.os }}-${{ matrix.cfg.cmake-arch }}-qt${{ matrix.cfg.qt-arch }}
126104
path: install\bin

0 commit comments

Comments
 (0)