Skip to content

Merge pull request #23 from pedrolcl/use-vcpkg-for-dependencies-in-ms… #14

Merge pull request #23 from pedrolcl/use-vcpkg-for-dependencies-in-ms…

Merge pull request #23 from pedrolcl/use-vcpkg-for-dependencies-in-ms… #14

Workflow file for this run

name: Windows MSVC CI
on:
workflow_dispatch:
push:
branches: [ "master", "devel" ]
pull_request:
branches: [ "master", "devel" ]
env:
BUILD_TYPE: RelWithDebInfo
INSTALL_LOCATION: ${{github.workspace}}/SonivoxV4
TEMP: ${{github.workspace}}/temp
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { icon: '🟪', arch: "win64", os: "windows-latest", triplet: "x64-windows" }
- { icon: '🟫', arch: "win32", os: "windows-latest", triplet: "x86-windows" }
- { icon: '🟩', arch: "arm64", os: "windows-11-arm", triplet: "arm64-windows" }
runs-on: ${{ matrix.os }}
name: 🚧${{ matrix.icon }} msvc ${{ matrix.arch }}
steps:
- uses: actions/checkout@v6
- name: '${{ matrix.icon }} Build vcpkg'
uses: johnwason/vcpkg-action@v7
id: vcpkg
with:
pkgs: gtest zlib
triplet: ${{ matrix.triplet }}
token: ${{ github.token }}
- name: '${{ matrix.icon }} Install NSIS'
uses: repolevedavaj/install-nsis@v1.1.0
with:
nsis-version: '3.11'
- name: '${{ matrix.icon }} Setup MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: '${{ matrix.icon }} Temp Environment Variable'
run: mkdir temp
- name: '${{ matrix.icon }} Downloading a DLS file for testing'
uses: ethanjli/cached-download-action@v0.1.3
with:
url: http://www.ronimusic.com/sf2/Airfont_340.dls
destination: ${{env.TEMP}}/soundfont.dls
cache-key: cached.soundfont.dls
enable-cross-os-archive: true
- name: '${{ matrix.icon }} Configure CMake'
id: configuration
run: >
cmake ${{ steps.vcpkg.outputs.vcpkg-cmake-config }}
-G Ninja -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
-DCPACK_SYSTEM_NAME=${{matrix.arch}}
-DDEPENDENCY_DIRS=${{github.workspace}}/vcpkg/installed/${{matrix.triplet}}/bin
-DINSTALL_DEPENDENCIES=ON
- name: '${{ matrix.icon }} Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: '${{ matrix.icon }} Test'
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --verbose
- name: '${{ matrix.icon }} Package'
run: cmake --build ${{github.workspace}}/build --target package
- name: '${{ matrix.icon }} Install'
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: '${{ matrix.icon }} Upload Artifacts'
uses: actions/upload-artifact@v6
with:
name: SonivoxV4-msvc-${{matrix.arch}}
path: ${{env.INSTALL_LOCATION}}
retention-days: 90
overwrite: true
- name: '${{ matrix.icon }} Upload Installer'
uses: actions/upload-artifact@v6
with:
name: SonivoxV4-msvc-installer-${{matrix.arch}}
path: ${{github.workspace}}/build/sonivox-${{steps.configuration.outputs.config_version}}-${{matrix.arch}}.exe
retention-days: 90
overwrite: true