-
Notifications
You must be signed in to change notification settings - Fork 18
59 lines (54 loc) · 1.87 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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 catch2
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: test-ccache-${{ runner.os }}-${{ runner.arch }}
- name: Build
run: |
cmake -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -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: Postprocess Junit XML
if: always()
run: |
# cursed XML fixup to add proper file and line number attributes
sed -i -e '
/<testcase.*[^/]>/,/<\/testcase>/{
H;
s/\s*<\/testcase>//;
T clean;
x;
s/<testcase \(.*\)at \([^:]*\):\([0-9]\+\)/<testcase file="\2" line="\3" \1at \2:\3/p
}
b;
:clean
d;' test-results/catch2-junit.xml
- 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/maps-core/maps-core/
comment_mode: off