[CI] Add nightly tests & builds #72
Workflow file for this run
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 Artifact" | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: 0 0 * * * | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: 'Tag name for release' | |
required: false | |
default: nightly | |
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" | |
TAG_NAME: "" | |
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 | |
- if: github.event_name == 'workflow_dispatch' | |
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- if: github.event_name == 'schedule' | |
run: echo "TAG_NAME=nightly" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- 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: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: CFB_${{ matrix.platform }}_${{ matrix.configuration }}_${{ github.sha }} | |
path: artifact/ | |
retention-days: 1 | |