Skip to content

Build

Build #141

Workflow file for this run

name: "Build Artifact"
on:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: 0 0 * * *
env:
CMAKE_FLAGS: "-DCFB_BUILD_TOOLS:BOOL=ON -DCFB_BUILD_TESTS:BOOL=ON -DCFB_BUILD_GUI:BOOL=ON"
CMAKE_TOOLCHAIN_FILE: "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
jobs:
build:
name: "${{ matrix.platform }}/${{ matrix.configuration }}"
strategy:
fail-fast: false
matrix:
os: ['windows-latest']
platform: ['x64', 'arm64']
configuration: ['Debug', 'RelWithDebInfo']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Prepare
shell: pwsh
run: |
echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
mkdir artifact
mkdir build
- name: Setup
shell: pwsh
run: |
Import-Module .\.github\Invoke-VisualStudio.ps1
Invoke-VisualStudio2022${{ matrix.platform }}
- name: Build
shell: pwsh
run: |
cmake -S . -B ./build -A ${{ matrix.platform }} ${{ env.CMAKE_FLAGS }}
cmake --build ./build --verbose --parallel ${{ env.NB_CPU }} --config ${{ matrix.configuration }}
- name: Test
continue-on-error: true
shell: pwsh
run: |
cd build
ctest --parallel ${{ env.NB_CPU }} --build-config ${{ matrix.configuration }} -T test
cd ..
- name: Install
shell: pwsh
run: |
cmake --install ./build --config ${{ matrix.configuration }} --prefix ./artifact --verbose
- name: Publish
uses: actions/upload-artifact@v3
with:
name: CFB_${{ matrix.platform }}_${{ matrix.configuration }}_${{ github.sha }}
path: artifact/