live-bootstrap/.github/workflows/bwrap.yml

91 lines
2.8 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:
sysa:
name: Run sysa 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: |
sysa/distfiles
sysc/distfiles
key: cache-${{ hashFiles('sys*/*/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: |
sysa/distfiles
sysc/distfiles
key: cache-${{ hashFiles('sys*/*/sources') }}
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --preserve --cores 2 --internal-ci pass1
- name: Archive created packages
if: failure() # archive failed builds progress
uses: actions/upload-artifact@v3
with:
name: packages
path: tmp/sysa/usr/src/repo/**
- name: Tar sysc_image
run: tar -cf sysc_image.tar tmp/sysa/sysc_image/
- name: Archive sysc_image
uses: actions/upload-artifact@v3
with:
name: sysc_image
path: sysc_image.tar
sysc:
name: Run sysc under bubblewrap
needs: sysa
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 sysc_image
uses: actions/download-artifact@v3
with:
name: sysc_image
- name: Extract sysc_image
run: tar -xf sysc_image.tar
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --preserve --cores 2 --internal-ci pass2
- name: Archive created packages
if: always() # archive failed builds
uses: actions/upload-artifact@v3
with:
name: packages
path: tmp/sysa/sysc_image/usr/src/repo/**