-
Notifications
You must be signed in to change notification settings - Fork 71
47 lines (38 loc) · 1.38 KB
/
build-win-vcpkg.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
name: build-win-vcpkg
on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
workflow_dispatch:
inputs:
ctestArgs:
description: 'CTest arguments'
env:
BUILD_TYPE: Release
VCPKG_DEFAULT_TRIPLET: x64-windows
# NOTE: The default is "x86-windows"
jobs:
build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install deps
run: vcpkg install fontconfig freetype libxml2 openssl libjpeg-turbo libpng tiff zlib
- name: Configure CMake
run: cmake -B ${{github.workspace}}\build -S . -A x64 -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
# NOTE1: The cmake build is forced to be single
# configuration (either Debug or Release) but it
# must be specified when running tests on Windows
# because of MSVC solution oddities
# NOTE2: vcpkg is installed in C:\vcpkg as per Github
# documentation, but VCPKG_INSTALLATION_ROOT variable
# doesn't seem to be defined
# https://github.com/actions/runner-images/blob/main/images/win/Windows2019-Readme.md
- name: Build
run: cmake --build ${{github.workspace}}\build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}\build
run: ctest ${{ github.event.inputs.ctestArgs }}