Merge pull request #9 from Stradek/add-badges-to-readme #39
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 Windows | |
env: | |
BUILD_DIR: "build/" | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
configure: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Remove build directory files | |
run: | | |
$buildDir = $env:BUILD_DIR | |
if (Test-Path $buildDir) | |
{ | |
Remove-Item $buildDir -Recurse -Force | |
} | |
- name: Configure CMake | |
run: cmake -G "Visual Studio 17 2022" -B $env:BUILD_DIR | |
- name: Save build directory | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: ${{ env.BUILD_DIR }} | |
build: | |
needs: configure | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
configuration: [Release, Debug] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Remove build directory if exists | |
run: | | |
$buildDir = $env:BUILD_DIR | |
if (Test-Path $buildDir) | |
{ | |
Remove-Item $buildDir -Recurse -Force | |
} | |
- name: Retrieve build directory | |
uses: actions/download-artifact@v3 | |
with: | |
name: build | |
path: ${{ env.BUILD_DIR }} | |
- name: Build ${{matrix.target}} (${{matrix.configuration}}) | |
run: cmake --build $env:BUILD_DIR --config ${{matrix.configuration}} |