From 6f9f4ba1f9a502d2a3d9042294f6663b5e712973 Mon Sep 17 00:00:00 2001 From: boeschf <48126478+boeschf@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:00:14 +0200 Subject: [PATCH] Less frequent sanitizer runs 2 (#2175) Reduce CI times by only running the sanitizer tests - when we commit to master - and once a week. In case of a failure during the weekly test, an automated issue is created (see [example issue](https://github.com/arbor-sim/arbor/issues/2194)). --- .github/workflows/sanitize.yml | 48 +++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml index 6762039add..8fd3c75772 100644 --- a/.github/workflows/sanitize.yml +++ b/.github/workflows/sanitize.yml @@ -1,10 +1,18 @@ name: Sanitize on: - pull_request: + push: branches: [ master ] paths-ignore: 'doc/**' + schedule: + - cron: '0 2 * * 0' # run at 2 AM every sunday + +permissions: + issues: write + pull-requests: write + contents: write + jobs: build: name: "Sanitize" @@ -58,7 +66,39 @@ jobs: cd - - name: Run unit tests run: | - build/bin/unit --gtest_filter=-*DeathTest - build/bin/unit-modcc + build/bin/unit --gtest_filter=-*DeathTest 2>&1 | tee output.log + build/bin/unit-modcc 2>&1 | tee -a output.log + shell: bash - name: Run examples - run: scripts/run_cpp_examples.sh + run: scripts/run_cpp_examples.sh 2>&1 | tee -a output.log + shell: bash + - name: Ouput File + if: ${{ failure() && github.event_name == 'schedule' }} + run: | + FENCE='```' + HEADER="$(cat << EOF +
+ + output from test runs + + ${FENCE} + EOF + )" + FOOTER="$(cat << EOF + ${FENCE} + +
+ EOF + )" + echo "${HEADER}" > issue.md + cat output.log >> issue.md + echo "${FOOTER}" >> issue.md + echo -e "\nSee also the [corresponding workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})\n" >> issue.md + - name: Create Issue From File + if: ${{ failure() && github.event_name == 'schedule' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: '[AUTOMATED] Sanitize checks failed' + content-filepath: ./issue.md + labels: | + automated issue