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 4e10cf2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/actions/ct-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@ inputs:
runs:
using: composite
steps:
- name: System info
shell: ${{ env.SHELL }}
run: |
ARCH=$(uname -m)
echo <<-EOF
## Setup
Architecture: $ARCH
- $(uname -a)
- $(nix --version || echo 'nix not present')
- $(bash --version | grep -m1 "")
- $(python3 --version)
- $(${{ inputs.cross_prefix }}${CC} --version | grep -m1 "")
EOF
cat >> $GITHUB_STEP_SUMMARY <<-EOF
## Setup
Architecture: $ARCH
- $(uname -a)
- $(nix --version || echo 'nix not present')
- $(bash --version | grep -m1 "")
- $(python3 --version)
- $(${{ inputs.cross_prefix }}${CC} --version | grep -m1 "")
EOF
- shell: ${{ env.SHELL }}
run: |
make clean
Expand Down
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
1 change: 1 addition & 0 deletions .github/workflows/ct-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
gh_token: ${{ secrets.GITHUB_TOKEN }}
nix-shell: ${{ matrix.nix-shell }}
nix-cache: true
nix-cache-prefix: valgrind-${{ runner.os }}-${{ runner.arch }}
- 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 4e10cf2

Please sign in to comment.