Skip to content

Commit

Permalink
Less frequent sanitizer runs 2 (#2175)
Browse files Browse the repository at this point in the history
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](#2194)).
  • Loading branch information
boeschf authored Aug 14, 2023
1 parent dfb0034 commit 6f9f4ba
Showing 1 changed file with 44 additions and 4 deletions.
48 changes: 44 additions & 4 deletions .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
<details>
<summary>output from test runs</summary>
${FENCE}
EOF
)"
FOOTER="$(cat << EOF
${FENCE}
</details>
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

0 comments on commit 6f9f4ba

Please sign in to comment.