ci: adjust caching strategy

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
This commit is contained in:
pasta 2024-10-24 22:05:01 -05:00
parent 354d6a9aab
commit cbeeb9e00d
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38

View File

@ -105,15 +105,12 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
depends/built
depends/${{ matrix.host }} depends/${{ matrix.host }}
depends/sdk-sources
# We don't care about no specific key as depends system will handle that for us # 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: | 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-${{ matrix.host }}
${{ runner.os }}-depends
- name: Build dependencies - name: Build dependencies
run: make -j$(nproc) -C depends HOST=${{ matrix.host }} run: make -j$(nproc) -C depends HOST=${{ matrix.host }}
@ -156,15 +153,16 @@ jobs:
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
with: with:
path: | path: |
depends/built
depends/${{ matrix.host }} depends/${{ matrix.host }}
depends/sdk-sources key: ${{ runner.os }}-depends-${{ matrix.host }}-${{ hashFiles('depends/packages/*') }}
# We don't care about no specific key as depends system will handle that for us
key: ${{ runner.os }}-depends-${{ matrix.host }}-${{ github.sha }}
restore-keys: | 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-${{ 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 - name: CCache
uses: actions/cache@v4 uses: actions/cache@v4
@ -174,8 +172,8 @@ jobs:
key: ${{ runner.os }}-${{ matrix.host }}-${{ github.sha }} key: ${{ runner.os }}-${{ matrix.host }}-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-${{ matrix.host }}-${{ github.sha }} ${{ runner.os }}-${{ matrix.host }}-${{ github.sha }}
${{ runner.os }}-${{ matrix.host }}-${{ steps.vars.outputs.PR_BASE_SHA }}
${{ runner.os }}-${{ matrix.host }} ${{ runner.os }}-${{ matrix.host }}
${{ runner.os }}
- name: Build source and run tests - name: Build source and run tests
run: | run: |