From 6850417e7a6eecee4fe855382132f4b8a9b4c4e6 Mon Sep 17 00:00:00 2001 From: Pedro Bianchini de Quadros <65463695+pedrobiqua@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:50:01 -0300 Subject: [PATCH] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 59 +++++++++++++--------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index b201cb1..19ab10d 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -1,4 +1,4 @@ -name: CMake Tests +name: CMake Build and Test on: push: @@ -6,33 +6,42 @@ on: 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