Commit 1708663a authored by Ralph Giles's avatar Ralph Giles
Browse files

github actions: Add a basic CMake build.

Run cmake build and test steps on the three supported desktop
targets. Default compiler and so on is fine.

Although we define an environment variable to hold the path
to the cmake build directory, we must use the noisier expression
syntax of the github job builder to substitute into each
command line for portability across both unix and windows
shell syntax.

The windows image also requires an explicit build config
switch, `-C Debug` or similar, for ctest to execute even
though CMakeLists.txt doesn't define alternate build
configurations. On linux and macos ctest runs fine without
the extra argument.
parent b674b567
name: CMake
on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *'
jobs:
build:
strategy:
matrix:
os:
[
ubuntu-latest,
macos-latest,
windows-latest,
]
runs-on: ${{ matrix.os }}
env:
BUILD: _build
steps:
- uses: actions/checkout@v2
- name: Prepare build directory
run: mkdir ${{ env.BUILD }}
- name: Generate
run: cmake -S . -B ${{ env.BUILD }}
- name: Build
run: cmake --build ${{ env.BUILD }}
- name: Test
run: ctest --test-dir ${{ env.BUILD }} -V -C Debug
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment