Skip to content

Commit

Permalink
CI: Only cache one valgrind per arch
Browse files Browse the repository at this point in the history
We are using a patched valgrind for the ct tests
which is built in CI and  then cached in the Github Cache.
Currently we are using many different compilers for these
tests. Currently, for each of these compilers valgrind
is recompiled and cached taking up 600-800 MB per
each of the 26 compiler/arch combinations.
We only have 10 GB of cache, so we are constantly triggering
cache evictions.
This leads to painfully slow tests for other tests that due to
that have to recompile gcc which takes around 45 minutes.

This commit changes the cache key for valgrind to only contain
the OS and arch, but not the compiler version.

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
  • Loading branch information
mkannwischer committed Feb 5, 2025
1 parent df9eb51 commit e3b2652
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/actions/setup-shell/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
nix-cache:
description: Determine whether to enable nix cache
default: 'false'
nix-cache-prefix:
description: Fixed prefix of ID of Github cache entries that should be removed.
required: false
nix-verbose:
description: Determine wether to suppress nix log or not
default: 'false'
Expand All @@ -35,6 +38,7 @@ runs:
verbose: ${{ inputs.nix-verbose }}
cache: ${{ inputs.nix-cache }}
script: ${{ inputs.script }}
cache_prefix: ${{ inputs.nix-cache-prefix }}
- name: Set custom shell
shell: bash
if: ${{ inputs.nix-shell == '' }}
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ct-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ jobs:
gh_token: ${{ secrets.GITHUB_TOKEN }}
nix-shell: ${{ matrix.nix-shell }}
nix-cache: true
nix-cache-prefix: valgrind-${{ runner.os }}-${{ runner.arch }}
script: |
ARCH=$(uname -m)
cat >> $GITHUB_STEP_SUMMARY <<-EOF
## Setup
Architecture: $ARCH
- $(uname -a)
- $(nix --version)
- $(gcc --version | grep -m1 "")
- $(bash --version | grep -m1 "")
## CPU Info
$(cat /proc/cpuinfo)
EOF
- name: Build and run test (-Oz)
# -Oz got introduced in gcc12
if: ${{ matrix.nix-shell != 'ci_valgrind-varlat_gcc48' && matrix.nix-shell != 'ci_valgrind-varlat_gcc49' && matrix.nix-shell != 'ci_valgrind-varlat_gcc7' && matrix.nix-shell != 'ci_valgrind-varlat_gcc11'}}
Expand Down

0 comments on commit e3b2652

Please sign in to comment.