Skip to content

Commit 7bd5b44

Browse files
committed
fix coverage test CI
1 parent 86c0bfc commit 7bd5b44

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,35 @@ jobs:
1515
with:
1616
fetch-depth: "0"
1717

18-
- name: Setup GCC
19-
uses: egor-tensin/setup-gcc@v1
20-
with:
21-
version: 13
22-
platform: x64
23-
18+
- name: Setup Clang
19+
run: |
20+
wget https://apt.llvm.org/llvm.sh
21+
chmod +x llvm.sh
22+
sudo ./llvm.sh 17
23+
sudo apt-get install libc++-17* libc++abi*17* llvm-17 -y
24+
echo "CC=clang-17" >> "$GITHUB_ENV"
25+
echo "CXX=clang++-17" >> "$GITHUB_ENV"
26+
2427
- name: Setup meson
2528
run: |
2629
python -m pip install --upgrade pip
2730
pip install meson
2831
29-
- name: Install dependencies (Linux)
32+
- name: Install dependencies
3033
run: |
3134
sudo apt-get update
32-
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* lcov gcovr -y
33-
35+
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y
36+
pip install gcovr
3437
3538
- name: Configure
36-
run: meson setup build -Dbuildtype=debug -Db_coverage=true -Dtests=true
39+
run: meson setup build -Dbuildtype=debug -Db_coverage=true -Dtests=true -Dclang_libcpp=enabled
3740

38-
- name: Build
39-
run: meson compile -C build
41+
- name: Run tests
42+
run: meson test -C build --verbose
4043

41-
- name: Coverage
44+
- name: Generate Coverage File
4245
run: |
43-
ninja coverage-xml -C build
44-
sed -i "s/<source>\.\.<\\/source>/<source>\.<\\/source>/g" "./build/meson-logs/coverage.xml"
46+
ninja coverage -C build
4547
4648
- name: Create Coverage Report
4749
uses: insightsengineering/coverage-action@v2
@@ -59,4 +61,6 @@ jobs:
5961
uses: actions/upload-artifact@v4
6062
with:
6163
name: Tests coverage artifacts
62-
path: build/meson-logs/coverage.xml
64+
path: |
65+
./build/meson-logs/coverage.xml
66+
./build/meson-logs/coveragereport/

0 commit comments

Comments
 (0)