From 549c489b111a122e33ca1450443c534e911c17fe Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 1 Apr 2024 14:07:40 +0300 Subject: [PATCH] AM-62 Extend Github actions with UT run and publishing report to PR --- .github/workflows/build_minimal_linux.yml | 23 +++++++++++++++++++-- .github/workflows/build_minimal_windows.yml | 8 ++++++- unit_tests/make_and_run_tests.sh | 2 +- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_minimal_linux.yml b/.github/workflows/build_minimal_linux.yml index 0944767..6f994cf 100644 --- a/.github/workflows/build_minimal_linux.yml +++ b/.github/workflows/build_minimal_linux.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: Linux build check on: push: @@ -6,6 +6,11 @@ on: pull_request: branches: [ "master" ] +permissions: + issues: write + pull-requests: write + checks: write + jobs: build: @@ -14,10 +19,24 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install packages - run: sudo apt -y install git g++ cmake libsqlite3-dev + run: sudo apt -y install git g++ cmake libsqlite3-dev gcovr - name: Clone aquamarine repo run: git clone https://github.com/MaksymT17/aquamarine.git - name: Build artifacts with Cmake run: | cd aquamarine ./build.sh + + - name: Run unit test + run: | + cd aquamarine/unit_tests + ./prepare_build.sh + cd build && + make -j8 && + ./aquamarine_ut --gtest_output="xml" + + - name: Publish Results + uses: EnricoMi/publish-unit-test-result-action@v1 + with: + check_name: Unit test results + files: "**/test_detail.xml" diff --git a/.github/workflows/build_minimal_windows.yml b/.github/workflows/build_minimal_windows.yml index 4c016ed..30b7065 100644 --- a/.github/workflows/build_minimal_windows.yml +++ b/.github/workflows/build_minimal_windows.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: Windows build check on: push: @@ -18,3 +18,9 @@ jobs: run: | cd aquamarine ./build.sh + + - name: Run unit tests + run: | + cd aquamarine/unit_tests + ./prepare_build.sh + ./make_and_run_tests.sh \ No newline at end of file diff --git a/unit_tests/make_and_run_tests.sh b/unit_tests/make_and_run_tests.sh index fab82e1..a10c6b4 100755 --- a/unit_tests/make_and_run_tests.sh +++ b/unit_tests/make_and_run_tests.sh @@ -4,7 +4,7 @@ cd build && make -j8 && echo "UNIT TESTS SCRIPT: Binaries ready, starting execution..." && -./aquamarine_ut && +./aquamarine_ut > am_test_result.txt && echo "UNIT TESTS SCRIPT: Execution of tests finished." && if [ $(dpkg-query -W -f='${Status}' valgrind 2>/dev/null | grep -c "ok installed") -eq 0 ]; then