Skip to content

Update vcpkg actions cache #10

Update vcpkg actions cache

Update vcpkg actions cache #10

Workflow file for this run

name: OnPush
on:
push:
branches: [ "develop", "main" ]
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
build_type: [Debug, Release]
compiler: [MSVC]
include:
- compiler: MSVC
c_compiler: cl
cxx_compiler: cl
asm_compiler: cl
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore vcpkg cache.
uses: actions/cache@v3
id: vcpkg-cache
with:
path: |
${{github.workspace}}/vcpkg/installed
key: |
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-${{hashFiles('scripts/vcpkg-manifest/vcpkg.json')}}
restore-keys: |
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-
- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.0
- name: Install vcpkg Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/vcpkg
run: .\bootstrap-vcpkg.bat
- name: Install Packages MSVC
if: runner.os == 'Windows' && matrix.compiler == 'MSVC'
working-directory: ${{github.workspace}}/vcpkg
run: vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=x64-windows
- name: Initialize MSVC Environment
if: matrix.compiler == 'MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{runner.arch}}
- name: Configure CMake
working-directory: ${{github.workspace}}
env:
CC: ${{matrix.c_compiler}}
CXX: ${{matrix.cxx_compiler}}
ASM: ${{matrix.asm_compiler}}
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE:STRING=./vcpkg/scripts/buildsystems/vcpkg.cmake -B out/build/${{runner.arch}}-${{matrix.build_type}} .
- name: Build
working-directory: ${{github.workspace}}
run: ninja -C out/build/${{runner.arch}}-${{matrix.build_type}} -j 2 VocalShaper
- name: Pre Packing Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}
run: .\prePacking.bat .\out\build\${{runner.arch}}-${{matrix.build_type}}\bin
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: VocalShaper-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{matrix.build_type}}-${{github.sha}}
path: |
out/build/${{runner.arch}}-${{matrix.build_type}}/bin/**
retention-days: 7
compression-level: 9