-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19d0a89
commit 6850417
Showing
1 changed file
with
34 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,47 @@ | ||
name: CMake Tests | ||
name: CMake Build and Test | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
checks: write | ||
|
||
jobs: | ||
build-and-test: | ||
build-test: | ||
name: Build & Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up build directory | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release .. | ||
make | ||
- name: Build and Run Tests with JUnit Report | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DGTEST_OUTPUT=xml:gtest-report.xml .. | ||
make | ||
./tests/unit-tests/LibUnitTests --gtest_output=xml:./gtest-report.xml | ||
- name: Run tests and generate JUnit report | ||
run: | | ||
cd build | ||
./tests/unit-tests/LibUnitTests --gtest_output=xml:./test-report.xml | ||
- name: Upload Test Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: gtest-report | ||
path: build/gtest-report.xml | ||
- name: Upload Test Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: gtest-report | ||
path: build/test-report.xml | ||
|
||
- name: Publish Test Results | ||
uses: dorny/test-reporter@v1 | ||
if: always() | ||
with: | ||
name: GTest Results | ||
path: build/gtest-report.xml | ||
reporter: jest-junit | ||
fail-on-error: false | ||
- name: Publish Test Results | ||
uses: dorny/test-reporter@v1 | ||
if: success() || failure() # run this step even if previous step failed | ||
with: | ||
name: Google Test Results # Custom name for the check | ||
path: build/test-report.xml # Path to the JUnit XML report | ||
reporter: jest-junit # Specify jest-junit to use the JUnit format | ||
fail-on-error: false |