Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of deprecated ::set-env in Windows-CI. #54

Merged
merged 1 commit into from
Nov 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 21 additions & 42 deletions .github/workflows/windows-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ on: [push, pull_request]

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

strategy:
matrix:
arch: ["x86", "x64"]
kf5: ["v5.70.0"]
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, kf5: v5.70.0, qt: 5.15.0, qt-arch: win32_msvc2019 }
- { os: windows-2019, generator: Visual Studio 16 2019, cmake-arch: x64, triplet: x64-windows-static-md, kf5: v5.70.0, qt: 5.15.0, qt_arch: win64_msvc2019_64 }

steps:
- uses: actions/checkout@v2
Expand All @@ -34,55 +30,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 @@ -93,12 +68,13 @@ jobs:
with:
repository: KDE/extra-cmake-modules
path: ecm
ref: ${{ matrix.kf5 }}
ref: ${{ matrix.cfg.kf5 }}
- name: Build ECM
run: |
cd ecm
mkdir build && cd build
cmake `
-G "${{ matrix.cfg.generator }}" -A ${{ matrix.cfg.cmake-arch }} `
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
-DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF `
..
Expand All @@ -111,14 +87,15 @@ jobs:
with:
repository: KDE/syntax-highlighting
path: syntax-highlighting
ref: ${{ matrix.kf5 }}
ref: ${{ matrix.cfg.kf5 }}

- uses: shogo82148/actions-setup-perl@v1
- name: Build KF5SyntaxHighlighting
run: |
cd syntax-highlighting
mkdir build && cd build
cmake `
-G "${{ matrix.cfg.generator }}" -A ${{ matrix.cfg.cmake-arch }} `
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
-DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF `
..
Expand All @@ -136,8 +113,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=OFF -DENABLE_PHYSX=OFF ..
cmake --build . --config Release -j 2
Expand All @@ -147,8 +125,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 @@ -166,5 +145,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 }}
path: install\bin