Skip to content

Commit 6850417

Browse files
authored
Update cmake-multi-platform.yml
1 parent 19d0a89 commit 6850417

File tree

1 file changed

+34
-25
lines changed

1 file changed

+34
-25
lines changed
+34-25
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
1-
name: CMake Tests
1+
name: CMake Build and Test
22

33
on:
44
push:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
88

9+
permissions:
10+
contents: read
11+
actions: read
12+
checks: write
13+
914
jobs:
10-
build-and-test:
15+
build-test:
16+
name: Build & Test
1117
runs-on: ubuntu-latest
12-
1318
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v4
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up build directory
23+
run: |
24+
mkdir build
25+
cd build
26+
cmake -DCMAKE_BUILD_TYPE=Release ..
27+
make
1628
17-
- name: Build and Run Tests with JUnit Report
18-
run: |
19-
mkdir build
20-
cd build
21-
cmake -DGTEST_OUTPUT=xml:gtest-report.xml ..
22-
make
23-
./tests/unit-tests/LibUnitTests --gtest_output=xml:./gtest-report.xml
29+
- name: Run tests and generate JUnit report
30+
run: |
31+
cd build
32+
./tests/unit-tests/LibUnitTests --gtest_output=xml:./test-report.xml
2433
25-
- name: Upload Test Report
26-
uses: actions/upload-artifact@v3
27-
with:
28-
name: gtest-report
29-
path: build/gtest-report.xml
34+
- name: Upload Test Report
35+
uses: actions/upload-artifact@v3
36+
with:
37+
name: gtest-report
38+
path: build/test-report.xml
3039

31-
- name: Publish Test Results
32-
uses: dorny/test-reporter@v1
33-
if: always()
34-
with:
35-
name: GTest Results
36-
path: build/gtest-report.xml
37-
reporter: jest-junit
38-
fail-on-error: false
40+
- name: Publish Test Results
41+
uses: dorny/test-reporter@v1
42+
if: success() || failure() # run this step even if previous step failed
43+
with:
44+
name: Google Test Results # Custom name for the check
45+
path: build/test-report.xml # Path to the JUnit XML report
46+
reporter: jest-junit # Specify jest-junit to use the JUnit format
47+
fail-on-error: false

0 commit comments

Comments
 (0)