Skip to content

Commit

Permalink
Improve the valgrind workflow (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Jan 8, 2025
1 parent 5b48fac commit dd5ef57
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [valgrind]
#if: ${{ github.repository == 'Akuli/jou' && always() && github.event_name == 'schedule' && needs.valgrind.result == 'failure' }}
if: ${{ github.repository == 'Akuli/jou' && always() && needs.valgrind.result == 'failure' }}
if: ${{ github.repository == 'Akuli/jou' && always() && github.event_name == 'schedule' && needs.valgrind.result == 'failure' }}
permissions:
issues: write
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.create({
owner: "Akuli",
repo: "jou",
title: `Running tests with valgrind failed on ${new Date().toDateString()}`,
body: "See valgrind output here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
})
- run: |
echo "Checking if there is already an issue about valgrind errors..."
if curl -s 'https://api.github.com/repos/${{ github.repository }}/issues?state=open' | jq '.[].title' | grep "Running tests with valgrind failed"; then
echo "There is already an open issue about the valgrind errors. Not creating a new one."
else
echo "No open issue found, creating a new one."
curl -s -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues \
-d '{"title": "Running tests with valgrind failed", "body": "Valgrind output is here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}'
fi

0 comments on commit dd5ef57

Please sign in to comment.