miniscule updates #87
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: C++ CI | |
on: [ push, pull_request ] | |
jobs: | |
precommit_checks: | |
runs-on: 'ubuntu-latest' | |
name: Pre-Commit Checks | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Update pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install and run pre-commit | |
uses: pre-commit/[email protected] | |
with: | |
extra_args: --all-files | |
matrix-strategy-setup: | |
needs: precommit_checks | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: set-matrix | |
run: | | |
TASKS=$(echo $(cat .github/workflows/build-matrix.json) | sed 's/ //g' ) | |
echo "matrix=$TASKS" >> $GITHUB_OUTPUT | |
build-test-install: | |
needs: matrix-strategy-setup | |
name: ${{ matrix.config.os }}_${{ matrix.config.cc }}-${{ matrix.config.compiler_version }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: ${{ fromJson(needs.matrix-strategy-setup.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Set up GCC | |
if: ${{ runner.os }} == "Linux" | |
uses: egor-tensin/setup-gcc@v1 | |
with: | |
version: ${{ matrix.config.compiler_version }} | |
platform: x64 | |
- name: Install conan | |
shell: bash | |
run: | | |
python3 -m pip install --upgrade pip setuptools | |
python3 -m pip install 'conan < 2' | |
- name: Install Doxygen | |
if: ${{ runner.os }} == "Linux" || ${{ runner.os }} == "macOS" | |
shell: bash | |
run: | | |
if [[ ${{ runner.os }} == 'Linux' ]]; then | |
sudo apt-get clean && sudo apt-get update && sudo apt-get install -y doxygen graphviz | |
elif [[ ${{ runner.os }} == 'macOS' ]]; then | |
brew install doxygen graphviz | |
elif [[ ${{ runner.os }} == 'Windows' ]]; then | |
echo "Deferring to chocolatey" | |
fi | |
- name: Chocolatey install Doxygen | |
if: runner.os == 'Windows' | |
uses: crazy-max/ghaction-chocolatey@v1 | |
with: | |
args: install doxygen.install graphviz --no-progress | |
- name: Source profile | |
if: runner.os == 'Linux' | |
shell: bash | |
run: source ~/.profile | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.22' | |
- name: Configure Windows compile environment | |
uses: ilammy/msvc-dev-cmd@v1 | |
if: runner.os == 'Windows' && matrix.config.cxx == 'cl' | |
with: | |
arch: amd64 | |
- name: Configure CMake | |
shell: bash | |
env: | |
CC: ${{ matrix.config.cc }} | |
CXX: ${{ matrix.config.cxx }} | |
run: > | |
cmake | |
-S . | |
-B ./build | |
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} | |
-DWARNINGS_AS_ERRORS:BOOL=OFF | |
-DUSE_PYBIND11_FINDPYTHON:BOOL=ON | |
- name: Build NOR Games | |
shell: bash | |
run: | | |
cmake --build ./build --config Release --target game_test_targets_all | |
- name: Build NOR Library | |
shell: bash | |
run: | | |
cmake --build ./build --config Release --target nor_tests_all | |
- name: Run Game Implementation Tests | |
shell: bash | |
run: > | |
GTEST_OUTPUT=xml:gtest-report-${{ github.jobs.build-test-install.name }}-games.xml | |
GTEST_COLOR=1 | |
ctest -R Test_game_.+_test | |
--test-dir ./build | |
--verbose | |
-C ${{ matrix.config.build_type }} | |
- name: Upload game test result artifacts | |
uses: actions/upload-artifact@v3 | |
if: success() | |
with: | |
name: gtest-results | |
path: ./build/**/gtest-report-${{ github.jobs.build-test-install.name }}-games.xml | |
retention-days: 1 | |
- name: Run No-Regret Tests | |
shell: bash | |
run: > | |
GTEST_OUTPUT=xml:gtest-report-${{ github.jobs.build-test-install.name }}.xml | |
GTEST_COLOR=1 | |
ctest -R Test_nor_tests_all | |
--test-dir ./build | |
--verbose | |
-C ${{ matrix.config.build_type }} | |
- name: Upload lib test result artifacts | |
uses: actions/upload-artifact@v3 | |
if: success() | |
with: | |
name: gtest-results | |
path: ./build/**/gtest-report-${{ github.jobs.build-test-install.name }}.xml | |
retention-days: 1 | |
publish-gtest-results: | |
name: "Publish GTest Results" | |
needs: build-test-install | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: gtest-results | |
path: ./artifacts/gtest-results_downloaded | |
- name: Display structure of downloaded files | |
run: ls | |
working-directory: ./artifacts/gtest-results_downloaded | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: ./artifacts/**/*.xml |