feat: complete refactor, ci compilation + test, CMake configs #67
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: Unit Tests | |
on: | |
push: | |
branches: [trunk] | |
pull_request: | |
branches: [trunk] | |
jobs: | |
unit_tests: | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true # if one matrix cell fails, the other ones keep going :) | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
package: [atchops, atclient] | |
steps: | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
# - name: CMake Configure, Make Install, and CTest | |
# uses: threeal/[email protected] | |
# with: | |
# source-dir: packages/${{ matrix.package }} | |
# generator: Unix Makefiles | |
# # args: -D$(echo "${{ matrix.package }}" | tr '[:lower:]' '[:upper:]')_BUILD_TESTS=ON # this doesn't work :/ | |
# args: -DATCLIENT_BUILD_TESTS=ON -DATCHOPS_BUILD_TESTS=ON | |
# build-dir: packages/${{ matrix.package }}/build | |
# run-build: true | |
# build-args: --target install | |
# run-test: false | |
# # run-test: true | |
# # test-args: -V --output-on-failure | |
- name: CMake Configure | |
# if: ${{ (matrix.os != 'windows-latest') || (matrix.package != 'atchops') }} | |
working-directory: packages/${{matrix.package}} | |
run: | | |
cmake -S . -B build -DATCLIENT_BUILD_TESTS=ON -DATCHOPS_BUILD_TESTS=ON | |
# - name: CMake Configure (Windows AtChops) | |
# if: ${{ (matrix.os == 'windows-latest') && (matrix.package == 'atchops') }} | |
# working-directory: packages/${{matrix.package}} | |
# run: | | |
# cmake -S . -B build -DATCHOPS_BUILD_TESTS=ON -DWINDOWS_BUILD=1 -DWINDOWS=1 | |
- name: Build and Install (Linux/MacOS) | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} | |
working-directory: packages/${{matrix.package}} | |
run: | | |
sudo cmake --build build --target install | |
- name: Build and Install (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
working-directory: packages/${{matrix.package}} | |
run: | | |
cmake --build build --config Debug | |
- name: CTest (Linux/MacOS) | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} | |
working-directory: packages/${{ matrix.package}}/build/tests | |
run: | | |
ctest -V --output-on-failure --timeout 2 | |
- name: CTest (Windows) | |
timeout-minutes: 1 | |
if: ${{ matrix.os == 'windows-latest' }} | |
working-directory: packages/${{ matrix.package}}/build/tests | |
run: | | |
ctest -V --output-on-failure -C Debug --timeout 10 |