Modify GH actions to support mirror

This commit is contained in:
fosslinux 2025-01-13 19:47:27 +11:00
parent 7d50a224c6
commit ba89224641
2 changed files with 28 additions and 27 deletions

View file

@ -32,20 +32,24 @@ jobs:
uses: actions/cache/restore@v4
with:
path: |
distfiles
mirror
mirror-state
key: cache-${{ hashFiles('steps/*/sources') }}
restore-keys: |
cache-
- name: Get sources
if: steps.cache.outputs.cache-hit != 'true'
run: ./download-distfiles.sh
run: mkdir -p mirror mirror-state && ./mirror.sh mirror mirror-state
- name: Cache sources
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
distfiles
mirror
mirror-state
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1 --mirror file://${PWD}/mirror
- name: Archive created packages
if: failure() # archive failed builds progress
uses: actions/upload-artifact@v4
@ -87,18 +91,12 @@ jobs:
uses: actions/cache/restore@v4
with:
path: |
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Get sources
if: steps.cache.outputs.cache-hit != 'true'
run: ./download-distfiles.sh
- name: Cache sources
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
distfiles
mirror
mirror-state
key: cache-${{ hashFiles('steps/*/sources') }}
fail-on-cache-miss: true
- name: Copy distfiles
run: ./download-distfiles.sh file:///${PWD}/mirror
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2
- name: Archive created packages
@ -142,20 +140,14 @@ jobs:
uses: actions/cache/restore@v4
with:
path: |
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Get sources
if: steps.cache.outputs.cache-hit != 'true'
run: ./download-distfiles.sh
- name: Cache sources
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
distfiles
mirror
mirror-state
key: cache-${{ hashFiles('steps/*/sources') }}
fail-on-cache-miss: true
- name: Copy distfiles
run: ./download-distfiles.sh file:///${PWD}/mirror
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3 --mirror file://${PWD}/mirror
- name: Archive created packages
if: always() # archive both failed and successful builds
uses: actions/upload-artifact@v4