Skip to content

Commit

Permalink
Update cmake-multi-platform.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobiqua authored Dec 12, 2024
1 parent 19d0a89 commit 6850417
Showing 1 changed file with 34 additions and 25 deletions.
59 changes: 34 additions & 25 deletions .github/workflows/cmake-multi-platform.yml
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

0 comments on commit 6850417

Please sign in to comment.