Merge pull request #6 from AWildErin/feat/readme #18
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
# Derived from https://github.com/craftablescience/sourcepp/blob/0952cbbe68cc7e66a2294b9deb18017ab45479c9/.github/workflows/build.yml | |
name: Build & Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
# nothing here | |
jobs: | |
build-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [Debug, Release] | |
compiler: [gcc] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Necessary Packages | |
run: sudo apt update && sudo apt install -y cmake build-essential | |
- name: Install GCC | |
if: ${{matrix.compiler == 'gcc'}} | |
uses: egor-tensin/setup-gcc@v1 | |
with: | |
version: latest | |
platform: x64 | |
- name: Configure CMake | |
run: cmake -G "Unix Makefiles" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_TESTS=ON | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest | |
build-msvc: | |
strategy: | |
matrix: | |
build_type: [Debug, Release] | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
spectre: true | |
- name: Configure CMake | |
run: cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_TESTS=ON | |
- name: Build | |
run: cmake --build build --config ${{matrix.build_type}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest |