live-bootstrap/.github/workflows/bwrap.yml
Gábor Stefanik 643577e049 Revert to seed tarball + packages for CI pass transitions
The seed tarball is created as early as possible, to minimize its size.
2023-12-27 19:14:58 +01:00

169 lines
5.7 KiB
YAML

# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Run under bubblewrap
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
pass1:
name: Run up to Linux build under bubblewrap
runs-on: ubuntu-latest
steps:
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
# There is a strange bug(?) in nongnu, when you clone a git repository
# against a commit != HEAD with depth=1, it errors out.
fetch-depth: 0
- name: Query cache for sources
id: cache
uses: actions/cache/restore@v3
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@v3
with:
path: |
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Run seed bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci start
- name: Tar seed image
run: tar -cf seed_image.tar target
- name: Archive seed_image
uses: actions/upload-artifact@v3
with:
name: seed_image
path: seed_image.tar
- name: Run pass1 bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci continue
- name: Archive created packages
if: always() # archive both failed and successful builds
uses: actions/upload-artifact@v3
with:
name: packages_pass1
path: target/external/repo/**
pass2:
name: Run up to Python bootstrap under bubblewrap
needs: pass1
runs-on: ubuntu-latest
steps:
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
# There is a strange bug(?) in nongnu, when you clone a git repository
# against a commit != HEAD with depth=1, it errors out.
fetch-depth: 0
- name: Get seed_image
uses: actions/download-artifact@v3
with:
name: seed_image
- name: Extract seed_image
run: tar -xf seed_image.tar
- name: Get pass1 packages
uses: actions/download-artifact@v3
with:
name: packages_pass1
path: target/external/repo-preseeded/
- name: Query cache for sources
id: cache
uses: actions/cache/restore@v3
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@v3
with:
path: |
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Preseed bootstrap with pass1
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci continue
- name: Run pass2 bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci continue
- name: Archive created packages
if: always() # archive both failed and successful builds
uses: actions/upload-artifact@v3
with:
name: packages_pass2
path: target/external/repo/**
pass3:
name: Run remaining builds under bubblewrap
needs: pass2
runs-on: ubuntu-latest
steps:
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
# There is a strange bug(?) in nongnu, when you clone a git repository
# against a commit != HEAD with depth=1, it errors out.
fetch-depth: 0
- name: Get seed_image
uses: actions/download-artifact@v3
with:
name: seed_image
- name: Extract seed_image
run: tar -xf seed_image.tar
- name: Get pass2 packages
uses: actions/download-artifact@v3
with:
name: packages_pass2
path: target/external/repo-preseeded/
- name: Query cache for sources
id: cache
uses: actions/cache/restore@v3
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@v3
with:
path: |
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Preseed bootstrap with pass1
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci continue
- name: Preseed bootstrap with pass2
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci continue
- name: Run pass3 bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci continue
- name: Archive created packages
if: always() # archive both failed and successful builds
uses: actions/upload-artifact@v3
with:
name: packages
path: target/external/repo/**