Skip to content

Commit

Permalink
ci: cache valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Feb 11, 2023
1 parent 4a9655b commit 62a5373
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ permissions:
# contents permission to update benchmark contents in gh-pages branch
contents: write

env:
VALGRIND_VERSION: '1:3.18.1-1ubuntu2'

jobs:
benchmark:
runs-on: ubuntu-latest
Expand All @@ -32,8 +35,24 @@ jobs:
- name: pnpm run build
run: pnpm run build

- name: Cache valgrind
uses: actions/cache@v3
id: cache-valgrind
with:
path: '~/valgrind'
key: ${{ runner.os }}-$VALGRIND_VERSION

- name: Install valgrind
run: sudo apt install -y valgrind
env:
CACHE_HIT: ${{steps.cache-valgrind.outputs.cache-hit}}
run: |
if [[ "$CACHE_HIT" == 'true' ]]; then
sudo cp --verbose --force --recursive ~/valgrind/* /
else
sudo apt-get install --yes valgrind="$VALGRIND_VERSION"
mkdir -p ~/valgrind
sudo dpkg -L valgrind | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/valgrind/
fi
- name: Setup cachegrind-benchmarking
run: node benchmark/setup-cachegrind-benchmarking.js
Expand Down

0 comments on commit 62a5373

Please sign in to comment.