Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/build-depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:

shell: bash

- name: Cache depends sources
uses: actions/cache@v4
- name: Restore depends sources
uses: actions/cache/restore@v4
with:
path: |
depends/sources
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi

cache-sources:
name: Cache depends sources
needs: [check-skip]
if: ${{ needs.check-skip.outputs.skip == 'false' }}
uses: ./.github/workflows/cache-depends-sources.yml

container:
name: Build container
needs: [check-skip]
Expand All @@ -60,7 +66,7 @@ jobs:
depends-arm-linux:
name: arm-linux-gnueabihf
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container, cache-sources]
if: ${{ vars.SKIP_ARM_LINUX == '' }}
with:
build-target: arm-linux
Expand All @@ -69,7 +75,7 @@ jobs:
depends-linux64:
name: x86_64-pc-linux-gnu
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container, cache-sources]
if: |
vars.SKIP_LINUX64 == '' ||
vars.SKIP_LINUX64_FUZZ == '' ||
Expand All @@ -82,7 +88,7 @@ jobs:
depends-linux64_multiprocess:
name: x86_64-pc-linux-gnu_multiprocess
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container, cache-sources]
if: |
vars.SKIP_LINUX64_MULTIPROCESS == '' ||
vars.SKIP_LINUX64_TSAN == ''
Expand All @@ -93,7 +99,7 @@ jobs:
depends-linux64_nowallet:
name: x86_64-pc-linux-gnu_nowallet
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container, cache-sources]
if: ${{ vars.SKIP_LINUX64_NOWALLET == '' }}
with:
build-target: linux64_nowallet
Expand All @@ -102,7 +108,7 @@ jobs:
depends-mac:
name: x86_64-apple-darwin
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container, cache-sources]
if: ${{ vars.SKIP_MAC == '' }}
with:
build-target: mac
Expand All @@ -111,7 +117,7 @@ jobs:
depends-win64:
name: x86_64-w64-mingw32
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container, cache-sources]
if: ${{ vars.SKIP_WIN64 == '' }}
with:
build-target: win64
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/cache-depends-sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Cache depends sources

on:
workflow_call:
schedule:
# Run daily at 6 AM UTC on the default branch to keep cache warm
- cron: '0 6 * * *'

jobs:
cache-sources:
name: Cache depends sources
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Check for cached sources
id: cache-check
uses: actions/cache@v4
with:
path: depends/sources
key: depends-sources-${{ hashFiles('depends/packages/*') }}
restore-keys: depends-sources-
lookup-only: true

- name: Download sources
if: steps.cache-check.outputs.cache-hit != 'true'
run: make -C depends download
Loading