From e062cfd287f9e4c0f2618ec415b9561777e06dc4 Mon Sep 17 00:00:00 2001 From: River <26424577+wusatosi@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:58:32 -0400 Subject: [PATCH 1/2] Implement schedule fault notification (#43) * implement schedule fault notification * Update documentations --- .github/workflows/ci_tests.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 671e28a..84602e7 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -69,3 +69,30 @@ jobs: run: | docker run ${{ matrix.cfg.id }} ctest --test-dir build -C Release docker run ${{ matrix.cfg.id }} ctest --test-dir build -C Debug + + create-issue-when-fault: + runs-on: ubuntu-latest + needs: [test] + if: failure() && github.event_name == 'schedule' + steps: + # See https://github.com/cli/cli/issues/5075 + - uses: actions/checkout@v4 + - name: Create issue + run: | + issue_num=$(gh issue list -s open -S "[SCHEDULED-BUILD] Build & Test failure" -L 1 --json number | jq 'if length == 0 then -1 else .[0].number end') + + body="**Build-and-Test Failure Report** + - **Time of Failure**: $(date -u '+%B %d, %Y, %H:%M %Z') + - **Commit**: [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) + - **Action Run**: [View logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + The scheduled build-and-test triggered by cron has failed. + Please investigate the logs and recent changes associated with this commit or rerun the workflow if you believe this is an error." + + if [[ $issue_num -eq -1 ]]; then + gh issue create --repo ${{ github.repository }} --title "[SCHEDULED-BUILD] Build & Test failure" --body "$body" + else + gh issue comment --repo ${{ github.repository }} $issue_num --body "$body" + fi + env: + GH_TOKEN: ${{ github.token }} From 325a07fe406dd8e5ee346d53f673ec5034bf6861 Mon Sep 17 00:00:00 2001 From: David Sankel Date: Tue, 8 Oct 2024 18:18:06 -0400 Subject: [PATCH 2/2] Simplify CMakeLists.txt (#42) * Simplify CMakeLists.txt The `block()` isn't needed since we can set CMake options via. CMAKE_ARGS. * Remove CMAKE_ARGS parameter that wasn't working. CMAKE_ARGS isn't used when a directory is brought in via `add_subdirectory`. Instead, variables need to be set in a block. Additionally, the block is only needed for the `FetchContent_MakeAvailable` call. --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 828ed70..a1a4550 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,16 +14,16 @@ include(FetchContent) if(BUILD_TESTING) enable_testing() + # Fetch GoogleTest + FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0 + EXCLUDE_FROM_ALL + ) block() - # Disable installing google test dependency on cmake --install - set(INSTALL_GTEST OFF) - - # Fetch GoogleTest - FetchContent_Declare( - googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0 - EXCLUDE_FROM_ALL CMAKE_ARGS -DBUILD_TESTING=OFF) + set(INSTALL_GTEST OFF) # Disable GoogleTest installation + set(BUILD_TESTING OFF) # Disable GoogleTest tests FetchContent_MakeAvailable(googletest) endblock() endif()