Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use actions/cache to manage depends cache #6406

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,20 @@ jobs:
restore-keys: |
depends-sources-

- name: Cache dependencies
- name: Cache depends
uses: actions/cache@v4
with:
path: |
depends/built
depends/${{ matrix.host }}
key: ${{ runner.os }}-depends-${{ matrix.build_target }}-${{ hashFiles('depends/packages/*') }}
restore-keys: |
${{ runner.os }}-depends-${{ matrix.build_target }}-${{ hashFiles('depends/packages/*') }}
${{ runner.os }}-depends-${{ matrix.build_target }}

- name: Build dependencies
- name: Build depends
run: make -j$(nproc) -C depends HOST=${{ matrix.host }}

- name: Upload built depends
uses: actions/upload-artifact@v4
with:
name: depends-${{ matrix.build_target }}
path: depends/${{ matrix.host }}

build:
name: Build
needs: [build-image, build-depends]
Expand Down Expand Up @@ -146,11 +141,13 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Download built depends
uses: actions/download-artifact@v4
- name: Restore depends cache
uses: actions/cache/restore@v4
with:
name: depends-${{ matrix.depends_on }}
path: depends/${{ matrix.host }}
path: |
depends/built
depends/${{ matrix.host }}
key: ${{ runner.os }}-depends-${{ matrix.depends_on }}-${{ hashFiles('depends/packages/*') }}

- name: Determine PR Base SHA
id: vars
Expand Down
Loading