Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
krupitskas authored Nov 28, 2024
1 parent 0efa2fa commit 9b3173b
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,60 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
strategy:
matrix:
configuration: [Debug, Profile, Release]
platform: [x64]
runs-on: windows-2022
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: ${{env.GITHUB_WORKSPACE}}
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
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{ env.Solution_Path }}

# Build the solution
- name: Build solution
run: |
msbuild ${{ env.Solution_Path }} -p:Configuration=${{ env.Configuration }} -p:Platform=${{ env.Platform }}
env:
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
msbuild ${{ env.Solution_Path }} /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}

0 comments on commit 9b3173b

Please sign in to comment.