Skip to content

Test cmake builds on github #9

Test cmake builds on github

Test cmake builds on github #9

Workflow file for this run

name: Build
on:
push:
branches:
- master
- jt-*
jobs:
build:
name: Build
runs-on: ${{ format('{0}-latest', matrix.os) }}
strategy:
matrix:
os:
- ubuntu
- windows
- macos
compiler:
- msvc
- gcc
exclude: # exclude invalid combinations of os/compiler
- os: ubuntu
compiler: msvc
- os: macos
compiler: msvc
include: # Windows adds .exe to the file names, msvc puts them in config-specific subdirs
- os: windows
ext: .exe
- compiler: msvc
buildconfig: /Debug
steps:
- uses: actions/checkout@v4
- name: Configure CMake (Windows - MSVC)
if: matrix.os == 'windows' && matrix.compiler == 'msvc'
run: |
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug
- name: Configure CMake (Windows - MinGW/GCC)
if: matrix.os == 'windows' && matrix.compiler == 'gcc'
run: |
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
- name: Configure CMake (Unix/MacOS - GCC)
if: (matrix.os == 'ubuntu' || matrix.os == 'macos') && matrix.compiler == 'gcc'
run: |
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
- name: Build
run: cmake --build build
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: |
build${{ matrix.buildconfig }}/basic${{ matrix.ext }}
build${{ matrix.buildconfig }}/fracas${{ matrix.ext }}
build${{ matrix.buildconfig }}/havilah${{ matrix.ext }}
build${{ matrix.buildconfig }}/kingdoms${{ matrix.ext }}
build${{ matrix.buildconfig }}/neworigins${{ matrix.ext }}
build${{ matrix.buildconfig }}/standard${{ matrix.ext }}
- name: Unit Tests
if: matrix.os == 'ubuntu' # Currently, unit tests only work correctly on ubuntu
run: ./build/unittest