Skip to content

Update to build against main #182

Update to build against main

Update to build against main #182

#
# .github/workflows/build-on-windows.yml
#
# Copyright 2021 Jens A. Koch.
# SPDX-License-Identifier: BSL-1.0
# This file is part of hikogui.
#
name: "Build on Windows"
on:
push:
branches:
- main
pull_request:
branches:
- main
# improve CI concurrency by automatically cancelling outdated jobs
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
CMAKE_CXX_COMPILER: ["cl", "clang"]
PACKAGE_MANAGER: ["FetchContent", "vcpkg", "vcpkg:head"]
exclude:
- CMAKE_CXX_COMPILER: clang
PACKAGE_MANAGE: ["vcpkg", "vcpkg:head"]

Check failure on line 32 in .github/workflows/build-on-win64.yml

View workflow run for this annotation

GitHub Actions / Build on Windows

Invalid workflow file

The workflow is not valid. .github/workflows/build-on-win64.yml (Line: 32, Col: 13): Matrix exclude key 'PACKAGE_MANAGE' does not match any key within the matrix
name: x64-windows ${{matrix.CMAKE_CXX_COMPILER}} ${{matrix.PACKAGE_MANAGER}}
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: windows-2022
env:
MATRIX_ID: ${{matrix.CMAKE_CXX_COMPILER}}-${{matrix.PACKAGE_MANAGER}}
BUILD_DIR: ${{github.workspace}}\build
INSTALL_DIR: ${{github.workspace}}\install
VCPKG_DIR: ${{github.workspace}}\external\vcpkg
defaults:
run:
shell: cmd
steps:
- name: πŸ”½ Checkout Code
uses: actions/checkout@v4 # https://github.com/actions/checkout
# https://community.chocolatey.org/packages/ninja
# https://community.chocolatey.org/packages/ccache
- name: πŸ”½ Install Ninja
run: choco install ninja ccache
- name: πŸ› οΈ Setup Visual Studio Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: πŸ”½ Install Vulkan SDK
uses: jakoch/[email protected] # https://github.com/jakoch/install-vulkan-sdk-action/
with:
vulkan_version: latest
optional_components: com.lunarg.vulkan.vma
install_runtime: true
cache: true
stripdown: true
# Build Artifact
# ---------------
# The ECPACK artifact contains files for building a signed installer, including the "ecpack.json" manifest file.
#
# Naming Scheme:
#
# - $ECPACK_NAME : hikogui-hello-world-0.3.0-win64
#
# When we package the ECPACK artifact:
#
# - ${{ECPACK_NAME}} is used to create a .json file and a storage directory with the suffix "-files"
# - ${{ECPACK_NAME}}-ecpack is used to name the final ecpack.zip file
#
- name: πŸ“ Fetch version data & set build artifact names
shell: pwsh
run: |
$NAME=$(jq -r .name vcpkg.json).replace('-', '_')
$VERSION=$(jq -r .version vcpkg.json)
echo "ECPACK_NAME=$NAME-$VERSION-win64" >> $env:GITHUB_ENV
- name: πŸ”½ Checkout VCPKG Code
if: matrix.PACKAGE_MANAGER == 'vcpkg' || matrix.PACKAGE_MANAGER == 'vcpkg:head'
uses: actions/checkout@v4 # https://github.com/actions/checkout
with:
repository: microsoft/vcpkg
path: ${{env.VCPKG_DIR}}
- name: πŸ› οΈ Setup VCPKG
if: matrix.PACKAGE_MANAGER == 'vcpkg' || matrix.PACKAGE_MANAGER == 'vcpkg:head'
working-directory: ${{env.VCPKG_DIR}}
run: .\bootstrap-vcpkg.bat
- name: ✏ CMake βž” Make Build Directory
shell: pwsh
run: mkdir "${{env.BUILD_DIR}}"
- name: ✏ CMake βž” Configure (FetchContent)
if: matrix.PACKAGE_MANAGER == 'FetchContent'
working-directory: ${{env.BUILD_DIR}}
shell: pwsh
run: >
cmake
-G "Ninja Multi-Config"
"-DCMAKE_C_COMPILER=${{matrix.CMAKE_CXX_COMPILER}}"
"-DCMAKE_CXX_COMPILER=${{matrix.CMAKE_CXX_COMPILER}}"
"-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}}"
"-DCMAKE_CONFIGURATION_TYPES=Debug;Release;RelWithDebInfo"
..
- name: ✏ CMake βž” Configure (vcpkg)
if: matrix.PACKAGE_MANAGER == 'vcpkg'
working-directory: ${{env.BUILD_DIR}}
shell: pwsh
run: >
cmake
-G "Ninja Multi-Config"
"-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_DIR}}\scripts\buildsystems\vcpkg.cmake"
"-DCMAKE_C_COMPILER=${{matrix.CMAKE_CXX_COMPILER}}"
"-DCMAKE_CXX_COMPILER=${{matrix.CMAKE_CXX_COMPILER}}"
"-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}}"
"-DCMAKE_CONFIGURATION_TYPES=Debug;Release;RelWithDebInfo"
..
- name: ✏ CMake βž” Configure (vcpkg:head)
if: matrix.PACKAGE_MANAGER == 'vcpkg:head'
working-directory: ${{env.BUILD_DIR}}
shell: pwsh
env:
VCPKG_OVERLAY_PORTS: "${{github.workspace}}\\vcpkg-overlay\\"
run: >
cmake
-G "Ninja Multi-Config"
"-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_DIR}}\scripts\buildsystems\vcpkg.cmake"
"-DCMAKE_C_COMPILER=${{matrix.CMAKE_CXX_COMPILER}}"
"-DCMAKE_CXX_COMPILER=${{matrix.CMAKE_CXX_COMPILER}}"
"-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}}"
"-DCMAKE_CONFIGURATION_TYPES=Debug;Release;RelWithDebInfo"
..
- name: πŸ™ CMake βž” Build Debug
working-directory: ${{env.BUILD_DIR}}
run: cmake --build . --config Debug --parallel 1
- name: πŸ“¦ CMake βž” Install Debug
working-directory: ${{env.BUILD_DIR}}
run: cmake --install . --config Debug
- name: πŸ™ CMake βž” Build RelWithDebInfo
working-directory: ${{env.BUILD_DIR}}
run: cmake --build . --config RelWithDebInfo --parallel 1
- name: πŸ“¦ CMake βž” Install RelWithDebInfo
working-directory: ${{env.BUILD_DIR}}
run: cmake --install . --config RelWithDebInfo
- name: πŸ™ CMake βž” Build Release
working-directory: ${{env.BUILD_DIR}}
run: cmake --build . --config Release --parallel 1
- name: πŸ“¦ CMake βž” Install Release
working-directory: ${{env.BUILD_DIR}}
run: cmake --install . --config Release
- name: πŸ“¦ CMake βž” Package
working-directory: ${{env.BUILD_DIR}}
run: |
cpack .
copy "${{env.ECPACK_NAME}}.json" "${{env.ECPACK_NAME}}-files\ecpack.json"
- name: πŸš€ Upload Artifact βž” ECPACK
if: matrix.CMAKE_CXX_COMPILER == 'cl' && matrix.PACKAGE_MANAGER == 'FetchContent'
uses: actions/upload-artifact@v3
with:
name: ${{env.ECPACK_NAME}}-ecpack
path: ${{env.BUILD_DIR}}\${{env.ECPACK_NAME}}-files\