Update build.yml #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Debug, Profile, Release] | |
platform: [x64] | |
runs-on: windows-latest | |
env: | |
Solution_Path: Yasno.sln | |
steps: | |
# Check out the repository code | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
# Cache vcpkg artifacts for faster builds | |
- name: Cache vcpkg | |
uses: actions/cache@v3 | |
with: | |
path: vcpkg/installed | |
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }} | |
restore-keys: | | |
vcpkg-${{ runner.os }} | |
# Add MSBuild to PATH | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
# Restore vcpkg packages | |
- name: Restore vcpkg packages | |
working-directory: ${{ github.workspace }} | |
run: vcpkg integrate install | |
# Cache NuGet packages for faster builds | |
- name: Cache NuGet packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.nuget/packages | |
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
nuget-${{ runner.os }} | |
# Restore NuGet packages | |
- name: Restore NuGet packages | |
run: nuget restore ${{ env.Solution_Path }} | |
# Build the solution | |
- name: Build solution | |
run: | | |
msbuild ${{ env.Solution_Path }} /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} |