Skip to content

Commit

Permalink
Remove deprecated ::set-env command usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoikas committed Nov 20, 2020
1 parent f83b32e commit 1db8baa
Showing 1 changed file with 17 additions and 39 deletions.
56 changes: 17 additions & 39 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ on: [push, pull_request]

jobs:
build:
runs-on: windows-latest
runs-on: ${{ matrix.cfg.os }}

strategy:
matrix:
arch: ["x86", "x64"]
qt: ["5.15.0"]

env:
CMAKE_GENERATOR: Visual Studio 16 2019
vcpkg-triplet: ${{ matrix.arch }}-windows-static-md
cfg:
- { os: windows-2019, generator: Visual Studio 16 2019, cmake-arch: Win32, triplet: x86-windows-static-md, qt: 5.15.0, qt-arch: win32_msvc2019 }
- { 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 }

steps:
- uses: actions/checkout@v2
Expand All @@ -31,55 +28,34 @@ jobs:
with:
path: C:\vcpkg\installed
key: |
vcpkg-triplet=${{ env.vcpkg-triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} vcpkg-rev=${{ steps.bootstrap-vcpkg.outputs.vcpkg-rev }}
vcpkg-triplet=${{ matrix.cfg.triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} vcpkg-rev=${{ steps.bootstrap-vcpkg.outputs.vcpkg-rev }}
restore-keys: |
vcpkg-triplet=${{ env.vcpkg-triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }}
vcpkg-triplet=${{ env.vcpkg-triplet }}
vcpkg-triplet=${{ matrix.cfg.triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }}
vcpkg-triplet=${{ matrix.cfg.triplet }}
- name: Upgrade Dependencies
if: steps.cache-vcpkg.outputs.cache-hit == 'true'
run: |
vcpkg upgrade --no-dry-run --triplet ${{ env.vcpkg-triplet }}
vcpkg upgrade --no-dry-run --triplet ${{ matrix.cfg.triplet }}
- name: Build Dependencies
run: |
vcpkg install `@vcpkg.txt --triplet ${{ env.vcpkg-triplet }}
vcpkg install `@vcpkg.txt --triplet ${{ matrix.cfg.triplet }}
vcpkg list --x-full-desc
- name: Configure Platform Arch
run: |
# Qt started providing both x86 and x64 builds for only MSVC 2019 as of 5.15. This was
# true only for MSVC 2017 before then.
[int[]]$qt_ver = "${{ matrix.qt }}".split('.')
if (($qt_ver[0] -eq 5) -and ($qt_ver[1] -lt 15)) {
$qt_compiler = "msvc2017"
} else {
$qt_compiler = "msvc2019"
}
if ("${{ matrix.arch }}" -eq "x86") {
$cmake_arch = "Win32"
$qt_arch = "win32_$($qt_compiler)"
} else {
$cmake_arch = "${{ matrix.arch }}"
$qt_arch = "win64_$($qt_compiler)_64"
}
Write-Host "::set-env name=CMAKE_GENERATOR_PLATFORM::$cmake_arch"
Write-Host "::set-env name=QT_ARCH::$qt_arch"
# Qt5 takes roughly a thousand years to build, so we download it from elsehwere...
- name: Restore Qt Cache
id: cache-qt
uses: actions/cache@v1
with:
path: ${{ github.workspace }}\qt
key: os=${{ runner.os }} qt=${{ matrix.qt }} arch=${{ env.qt_arch }}
key: os=${{ runner.os }} qt=${{ matrix.cfg.qt }} arch=${{ matrix.cfg.qt-arch }}

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
arch: ${{ env.QT_ARCH }}
version: ${{ matrix.qt }}
arch: ${{ matrix.cfg.qt-arch }}
version: ${{ matrix.cfg.qt }}
dir: ${{ github.workspace }}\qt
cached: ${{ steps.cache-qt.outputs.cache-hit }}
aqtversion: ==0.9.*
Expand All @@ -95,8 +71,9 @@ jobs:
cd libhsplasma
mkdir build && cd build
cmake `
-G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" `
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} `
-DVCPKG_TARGET_TRIPLET=${{ matrix.cfg.triplet }} `
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
-DENABLE_PYTHON=OFF -DENABLE_TOOLS=OFF -DENABLE_NET=ON -DENABLE_PHYSX=OFF ..
cmake --build . --config Release -j 2
Expand All @@ -106,8 +83,9 @@ jobs:
run: |
mkdir build && cd build
cmake `
-G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" `
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} `
-DVCPKG_TARGET_TRIPLET=${{ matrix.cfg.triplet }} `
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
..
cmake --build . --config Release -j 2
Expand All @@ -122,5 +100,5 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.arch }}-qt${{ matrix.qt }}
name: ${{ runner.os }}-${{ matrix.cfg.cmake-arch }}-qt${{ matrix.cfg.qt-arch }}
path: install\bin

0 comments on commit 1db8baa

Please sign in to comment.