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

Configure GitHub Actions to run tests with valgrind every night instead of every pull request #552

Merged
merged 7 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
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
17 changes: 1 addition & 16 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: sudo apt update
- run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make valgrind
- run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make
- run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make
- run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }}"
- run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }} --verbose"
# Valgrinding is slow, but many files affect valgrind results.
# We skip it when all changes are to .md files (docs, README etc)
- name: Figure out if we need to run tests with valgrind
id: check-need-valgrind
run: |
git fetch https://github.com/Akuli/jou main
# Find modified non-markdown files. If there are any, set doit=yes.
if git diff --name-only FETCH_HEAD HEAD | grep -vE '\.md$'; then
echo doit=yes >> $GITHUB_OUTPUT
else
echo doit=no >> $GITHUB_OUTPUT
fi
- if: ${{ steps.check-need-valgrind.outputs.doit == 'yes' }}
run: ./runtests.sh --verbose --valgrind --jou-flags "${{ matrix.opt-level }}"
# valgrind+verbose isn't meaningful: test script would ignore valgrind output
- run: make clean
- name: Check that "make clean" deleted all files not committed to Git
run: |
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,28 @@ jobs:
opt-level: ['-O0', '-O1', '-O2', '-O3']
steps:
- uses: actions/checkout@v3
- run: sudo apt update
- run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make valgrind
- run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make
#- run: ./runtests.sh --verbose --valgrind --jou-flags "${{ matrix.opt-level }}"
- run: echo "Valgrinding... Brrr..."
- run: cat oh no this command will error

# Do not valgrind when there's nothing new to valgrind in the repo
- name: Check if there was any commits within the last 24 hours
run: |
if git --no-pager log --oneline --since="24 hours ago" --exit-code; then
echo "No commits, will not run valgrind"
echo "recent_commits=false" >> $GITHUB_ENV
else
echo "recent_commits=true" >> $GITHUB_ENV
fi

- if: env.recent_commits == 'true'
run: sudo apt update

- if: env.recent_commits == 'true'
run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make valgrind

- if: env.recent_commits == 'true'
run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make

- if: env.recent_commits == 'true'
run: ./runtests.sh --verbose --valgrind --jou-flags "${{ matrix.opt-level }}"

# Based on: https://github.com/python/typeshed/blob/9f28171658b9ca6c32a7cb93fbb99fc92b17858b/.github/workflows/daily.yml
create-issue-on-failure:
Expand Down
Loading