Skip to content

Adding schedule task to GHActions #56

Adding schedule task to GHActions

Adding schedule task to GHActions #56

Workflow file for this run

name: "Build Artifact"
on:
schedule:
- cron: 0 0 * * *
push:
pull_request:
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.os }}/${{ 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: Sets Windows specific environment variables
if: matrix.os == 'windows-latest'
shell: powershell
run: |
echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup msbuild
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Import-Module .\.github\Invoke-VisualStudio.ps1
Invoke-VisualStudio2022${{ matrix.platform }}
- name: Build CFB
run: |
mkdir ./build
cmake -S . -B ./build -A ${{ matrix.platform }} ${{ env.CMAKE_FLAGS }}
cmake --build ./build --verbose --parallel ${{ env.NB_CPU }} --config ${{ matrix.configuration }}
- name: Run tests
if: matrix.configuration == 'RelWithDebInfo' && matrix.platform == 'x64'
continue-on-error: true
run: |
cd build
ctest --parallel ${{ env.NB_CPU }} --build-config ${{ matrix.configuration }} -T test
cd ..
- name: Prepare artifact
if: matrix.configuration == 'RelWithDebInfo'
run: |
mkdir artifact
cmake --install ./build --config ${{ matrix.configuration }} --prefix ./artifact --verbose
- name: Publish artifact
uses: actions/upload-artifact@v3
if: matrix.configuration == 'RelWithDebInfo'
with:
name: CFB_${{ matrix.platform }}_${{ matrix.configuration }}_${{ github.ref_name }}_${{ github.sha }}
path: artifact/
retention-days: 1