actions: optimize sources caching

This commit is contained in:
tobtoht 2023-05-30 17:58:48 +02:00
parent 1ea1887717
commit 279cbaf81d

View file

@ -9,8 +9,23 @@ env:
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
jobs: jobs:
build-cross: cache-sources:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: depends sources cache
uses: actions/cache@v3
with:
path: contrib/depends/sources
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
- name: download depends sources
run: make -C contrib/depends download
build-guix:
runs-on: ubuntu-latest
needs: [cache-sources]
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -46,9 +61,6 @@ jobs:
gnu/store gnu/store
guix_db.sqlite guix_db.sqlite
key: guix-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/guix/manifest.scm') }} key: guix-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/guix/manifest.scm') }}
restore-keys: |
depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/guix/manifest.scm') }}
depends-${{ matrix.toolchain.host }}-
- name: move guix store - name: move guix store
run: | run: |
if [[ -e "guix_db.sqlite" ]]; then if [[ -e "guix_db.sqlite" ]]; then
@ -65,17 +77,11 @@ jobs:
with: with:
path: contrib/depends/built path: contrib/depends/built
key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }} key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
restore-keys: |
depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
depends-${{ matrix.toolchain.host }}-
- name: depends sources cache - name: depends sources cache
uses: actions/cache@v3 uses: actions/cache/restore@v3
with: with:
path: contrib/depends/sources path: contrib/depends/sources
key: sources-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }} key: sources-${{ hashFiles('contrib/depends/packages/*') }}
restore-keys: |
depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
depends-${{ matrix.toolchain.host }}-
- name: set apt conf - name: set apt conf
run: ${{env.APT_SET_CONF}} run: ${{env.APT_SET_CONF}}
- name: install dependencies - name: install dependencies