Skip to content

Merge branch 'develop' #60

Merge branch 'develop'

Merge branch 'develop' #60

Workflow file for this run

# The name should be a single word because the name is shown by the build
# status badge we display in the README.
name: build
on: [push, pull_request]
jobs:
build:
name: Build, test and dummy-install
# Build matrix notes:
# - Since this is a cross-platform library we want to build on all three of
# the major operating systems.
# - We use the *-latest runners because we strive to build with relatively
# new versions of each environment that have modern compilers (we need at
# least C++17, see CMakeLists.txt) and tools.
# - The library should not only be cross-platform, it should also not rely
# on any particular compiler. On macOS the clang compiler is used
# (AppleClang), on Ubuntu the default is GNU GCC, and on Windows it's
# MSVC.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checking out the sources
# @v4 refers to the Git tag "v4" in https://github.com/actions/checkout.
# The repo maintainers update the "v4" tag to always point to the latest
# v4 release of the checkout action.
uses: actions/checkout@v4
with:
submodules: recursive
- name: Generate build system (macOS and Ubuntu)
run: |
mkdir build
cd build
# We specify the configuration for single-configuration build systems
# like make. For multi-configuration build systems like Visual Studio
# this has no effect (it generates a CMake warning in the build output).
cmake -DCMAKE_BUILD_TYPE=Release ..
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
- name: Generate build system (Windows)
run: |
mkdir build
cd build
cmake ..
if: matrix.os == 'windows-latest'
- name: Build the project
run: |
cd build
# Specify the configuration for multi-configuration build systems like
# VisualStudio. For single-configuration build systems this would not be
# necessary since we specified the configuration already when the build
# system was generated.
cmake --build . --config Release
- name: Test the build (macOS and Ubuntu)
run: |
cd build
# Execute unit tests. We could run "ctest", but invoking the Catch2 test
# runner directly provides better feedback.
./test/libsgfcplusplus-test
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
- name: Test the build (Windows)
run: |
cd build
# Execute unit tests. We could run "ctest", but invoking the Catch2 test
# runner directly provides better feedback.
./test/Release/libsgfcplusplus-test
if: matrix.os == 'windows-latest'
- name: Install the build
run: |
cd build
# Perform a dummy deploy to test the CMake install routine.
# See comment above re: use of --config option.
cmake --install . --config Release --prefix install