Skip to content

Commit

Permalink
ci: adjust caching strategy
Browse files Browse the repository at this point in the history
use hashFiles('depends/packages/*') for depends stuff
don't mix stuff between hosts
try to use PR base if we don't have direct match for ccache
  • Loading branch information
PastaPastaPasta committed Oct 25, 2024
1 parent 89349a5 commit e3d076d
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,12 @@ jobs:
uses: actions/cache@v4
with:
path: |
depends/built
depends/${{ matrix.host }}
depends/sdk-sources
# We don't care about no specific key as depends system will handle that for us
key: ${{ runner.os }}-depends-${{ matrix.host }}-${{ github.sha }}
key: ${{ runner.os }}-depends-${{ matrix.host }}-${{ hashFiles('depends/packages/*') }}
restore-keys: |
${{ runner.os }}-depends-${{ matrix.host }}-${{ github.sha }}
${{ runner.os }}-depends-${{ matrix.host }}-${{ hashFiles('depends/packages/*') }}
${{ runner.os }}-depends-${{ matrix.host }}
${{ runner.os }}-depends
- name: Build dependencies
run: make -j$(nproc) -C depends HOST=${{ matrix.host }}
Expand Down Expand Up @@ -156,15 +153,16 @@ jobs:
uses: actions/cache/restore@v4
with:
path: |
depends/built
depends/${{ matrix.host }}
depends/sdk-sources
# We don't care about no specific key as depends system will handle that for us
key: ${{ runner.os }}-depends-${{ matrix.host }}-${{ github.sha }}
key: ${{ runner.os }}-depends-${{ matrix.host }}-${{ hashFiles('depends/packages/*') }}
restore-keys: |
${{ runner.os }}-depends-${{ matrix.host }}-${{ github.sha }}
${{ runner.os }}-depends-${{ matrix.host }}-${{ hashFiles('depends/packages/*') }}
${{ runner.os }}-depends-${{ matrix.host }}
${{ runner.os }}-depends
- name: Determine PR Base SHA
id: vars
run: |
echo "PR_BASE_SHA=${{ github.event.pull_request.base.sha || '' }}" >> $GITHUB_OUTPUT
- name: CCache
uses: actions/cache@v4
Expand All @@ -174,8 +172,8 @@ jobs:
key: ${{ runner.os }}-${{ matrix.host }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.host }}-${{ github.sha }}
${{ runner.os }}-${{ matrix.host }}-${{ steps.vars.outputs.PR_BASE_SHA }}
${{ runner.os }}-${{ matrix.host }}
${{ runner.os }}
- name: Build source and run tests
run: |
Expand Down

0 comments on commit e3d076d

Please sign in to comment.