Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the valgrind workflow #571

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading