github: Only store a cache for large custom-built crypto libs
The others are either included already in the "all" build (to which we now switch) or they have a relatively small diff to that (e.g. gcrypt only differs in that relatively small plugin). For the "openssl-sys" build, we can rely on the "default" build but only on ubuntu-latest as we don't build that on ubuntu-22.04.
This commit is contained in:
+14
-15
@@ -146,19 +146,25 @@ jobs:
|
|||||||
CC: ${{ matrix.compiler || 'gcc' }}
|
CC: ${{ matrix.compiler || 'gcc' }}
|
||||||
TEST: ${{ matrix.test }}
|
TEST: ${{ matrix.test }}
|
||||||
ACTIVE_TRANSFORMS_REF: .github/active-transforms/${{ matrix.test }}
|
ACTIVE_TRANSFORMS_REF: .github/active-transforms/${{ matrix.test }}
|
||||||
|
# only store a cache for some tests as the others have a minimal diff (if
|
||||||
|
# any) compared to the 'all' build
|
||||||
STORE_CACHE: >-
|
STORE_CACHE: >-
|
||||||
${{ github.event_name == 'push' &&
|
${{ github.event_name == 'push' &&
|
||||||
|
contains(fromJSON('["openssl-4", "openssl-awslc"]'), matrix.test) &&
|
||||||
(!matrix.leak-detective || matrix.leak-detective == 'no') }}
|
(!matrix.leak-detective || matrix.leak-detective == 'no') }}
|
||||||
|
CACHE_KEY: >-
|
||||||
|
${{ case(contains(fromJSON('["openssl-4", "openssl-awslc"]'), matrix.test),
|
||||||
|
format('ccache-{0}-gcc-{1}', matrix.os, matrix.test),
|
||||||
|
matrix.os == 'ubuntu-latest' && matrix.test == 'openssl-sys',
|
||||||
|
format('ccache-{0}-gcc-default', matrix.os),
|
||||||
|
format('ccache-{0}-gcc-all', matrix.os)) }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/cache/restore@v5
|
- uses: actions/cache/restore@v5
|
||||||
id: cache-restore
|
id: cache-restore
|
||||||
with:
|
with:
|
||||||
# path is different on newer systems
|
path: ~/.cache/ccache
|
||||||
path: |
|
key: ${{ env.CACHE_KEY }}
|
||||||
~/.cache/ccache
|
|
||||||
~/.ccache
|
|
||||||
key: ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}
|
|
||||||
- run: |
|
- run: |
|
||||||
sudo apt-get install -qq ccache
|
sudo apt-get install -qq ccache
|
||||||
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
|
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
|
||||||
@@ -184,9 +190,7 @@ jobs:
|
|||||||
- if: fromJSON(env.STORE_CACHE)
|
- if: fromJSON(env.STORE_CACHE)
|
||||||
uses: actions/cache/save@v5
|
uses: actions/cache/save@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: ~/.cache/ccache
|
||||||
~/.cache/ccache
|
|
||||||
~/.ccache
|
|
||||||
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
|
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
|
||||||
- if: ${{ failure() }}
|
- if: ${{ failure() }}
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
@@ -216,10 +220,7 @@ jobs:
|
|||||||
- uses: actions/cache/restore@v5
|
- uses: actions/cache/restore@v5
|
||||||
id: cache-restore
|
id: cache-restore
|
||||||
with:
|
with:
|
||||||
# path is different on newer systems
|
path: ~/.cache/ccache
|
||||||
path: |
|
|
||||||
~/.cache/ccache
|
|
||||||
~/.ccache
|
|
||||||
key: ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}
|
key: ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}
|
||||||
- run: |
|
- run: |
|
||||||
sudo apt-get install -qq ccache
|
sudo apt-get install -qq ccache
|
||||||
@@ -236,9 +237,7 @@ jobs:
|
|||||||
- if: github.event_name == 'push'
|
- if: github.event_name == 'push'
|
||||||
uses: actions/cache/save@v5
|
uses: actions/cache/save@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: ~/.cache/ccache
|
||||||
~/.cache/ccache
|
|
||||||
~/.ccache
|
|
||||||
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
|
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
|
||||||
- if: ${{ failure() }}
|
- if: ${{ failure() }}
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
|
|||||||
Reference in New Issue
Block a user