42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: C++ Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
- "claude/**"
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: eulernest
|
|
container:
|
|
image: git.eulernest.eu/conformallab/ci-cpp:latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Configure (tests-only mode)
|
|
run: cmake -S code -B build -DCMAKE_BUILD_TYPE=Release
|
|
|
|
- name: Build test binary
|
|
run: cmake --build build --target conformallab_tests -j$(nproc)
|
|
|
|
- name: Run tests
|
|
run: >
|
|
ctest --test-dir build
|
|
--output-on-failure
|
|
--output-junit test-results.xml
|
|
|
|
- name: Show test summary
|
|
if: always()
|
|
run: |
|
|
if [ -f test-results.xml ]; then
|
|
total=$(grep -o 'tests="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
|
|
failed=$(grep -o 'failures="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
|
|
skipped=$(grep -o 'skipped="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
|
|
passed=$(( ${total:-0} - ${failed:-0} - ${skipped:-0} ))
|
|
echo "TOTAL: ${total:-0} | PASSED: $passed | FAILED: ${failed:-0} | SKIPPED: ${skipped:-0}"
|
|
fi
|