Add Catch2 for testing shared code, GeoJSON parser fixes #16
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: test | |
on: | |
pull_request: | |
branches: [ main, develop, release/** ] | |
push: | |
branches: [ main, develop, release/** ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Install build tools and dependencies | |
run: sudo apt-get update && sudo apt-get install cmake ninja-build clang libgl-dev libgles-dev | |
- name: Cache build directory | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cmake-build-debug | |
with: | |
path: build-debug | |
key: ${{ runner.os }} | |
restore-keys: | | |
${{ runner.os }} | |
- name: Build | |
run: | | |
cmake -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DBUILD_JVM=OFF -DBUILD_STANDALONE=OFF -B build-debug | |
cmake --build build-debug -- tests | |
- name: Test | |
run: | | |
mkdir test-results | |
cd shared/test # for access to data/ directory | |
../../build-debug/shared/test/tests \ | |
--skip-benchmarks \ | |
-r JUnit::out=../../test-results/catch2-junit.xml \ | |
-r console::colour-mode=ansi | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
test-results/catch2-junit.xml | |
test_file_prefix: -/home/runner/work/ | |
comment_mode: off |