2023-03-15 06:46:11 +00:00
|
|
|
# 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:
|
2023-03-16 08:09:13 +00:00
|
|
|
branches:
|
|
|
|
- master
|
2023-03-15 06:46:11 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-12-23 06:20:33 +00:00
|
|
|
pass1:
|
|
|
|
name: Run up to Linux build under bubblewrap
|
2023-03-15 06:46:11 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install bubblewrap
|
|
|
|
run: sudo apt install bubblewrap
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2023-04-28 13:19:29 +01:00
|
|
|
# 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
|
2023-03-15 06:46:11 +00:00
|
|
|
- name: Query cache for sources
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
path: |
|
2023-12-25 10:09:51 +00:00
|
|
|
distfiles
|
2023-12-23 06:20:33 +00:00
|
|
|
key: cache-${{ hashFiles('steps/*/sources') }}
|
2023-03-15 06:46:11 +00:00
|
|
|
- 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: |
|
2023-12-25 10:09:51 +00:00
|
|
|
distfiles
|
2023-12-23 06:20:33 +00:00
|
|
|
key: cache-${{ hashFiles('steps/*/sources') }}
|
2023-03-15 06:46:11 +00:00
|
|
|
- name: Run bootstrap
|
2023-12-26 03:28:47 +00:00
|
|
|
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1
|
2023-05-01 11:49:46 +01:00
|
|
|
- name: Archive created packages
|
|
|
|
if: failure() # archive failed builds progress
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: packages
|
2023-12-26 03:28:47 +00:00
|
|
|
path: target/external/repo/**
|
2023-12-23 06:20:33 +00:00
|
|
|
- name: Tar pass1 image
|
2023-12-26 03:28:47 +00:00
|
|
|
run: tar -cf pass1_image.tar target
|
2023-12-23 06:20:33 +00:00
|
|
|
- name: Archive pass1_image
|
2023-05-01 11:49:46 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-12-23 06:20:33 +00:00
|
|
|
name: internal_pass1_image
|
|
|
|
path: pass1_image.tar
|
2023-05-01 11:49:46 +01:00
|
|
|
|
2023-12-23 06:20:33 +00:00
|
|
|
pass2:
|
|
|
|
name: Run up to Python bootstrap under bubblewrap
|
|
|
|
needs: pass1
|
2023-05-01 11:49:46 +01:00
|
|
|
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
|
2023-12-23 06:20:33 +00:00
|
|
|
- name: Get pass1_image
|
2023-05-01 11:49:46 +01:00
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-12-23 06:20:33 +00:00
|
|
|
name: internal_pass1_image
|
|
|
|
- name: Extract pass1_image
|
|
|
|
run: tar -xf pass1_image.tar
|
2023-12-25 10:04:18 +00:00
|
|
|
- name: Query cache for sources
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
path: |
|
2023-12-25 10:09:51 +00:00
|
|
|
distfiles
|
2023-12-25 10:04:18 +00:00
|
|
|
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: |
|
2023-12-25 10:09:51 +00:00
|
|
|
distfiles
|
2023-12-25 10:04:18 +00:00
|
|
|
key: cache-${{ hashFiles('steps/*/sources') }}
|
2023-05-01 11:49:46 +01:00
|
|
|
- name: Run bootstrap
|
2023-12-26 03:28:47 +00:00
|
|
|
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2
|
2023-05-02 23:48:40 +01:00
|
|
|
- name: Archive created packages
|
2023-12-25 21:41:44 +00:00
|
|
|
if: failure() # archive failed builds progress
|
2023-05-02 23:48:40 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-12-23 06:20:33 +00:00
|
|
|
name: internal_packages_pass2
|
2023-12-26 03:28:47 +00:00
|
|
|
path: target/external/repo/**
|
2023-12-25 21:41:44 +00:00
|
|
|
- name: Tar pass2 image
|
2023-12-26 03:28:47 +00:00
|
|
|
run: tar -cf pass2_image.tar target
|
2023-12-25 21:41:44 +00:00
|
|
|
- name: Archive pass2_image
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: internal_pass2_image
|
|
|
|
path: pass2_image.tar
|
2023-05-02 23:48:40 +01:00
|
|
|
|
2023-12-23 06:20:33 +00:00
|
|
|
pass3:
|
|
|
|
name: Run remaining builds under bubblewrap
|
|
|
|
needs: pass2
|
2023-05-02 23:48:40 +01:00
|
|
|
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
|
2023-12-25 21:41:44 +00:00
|
|
|
- name: Get pass2_image
|
2023-05-02 23:48:40 +01:00
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-12-25 21:41:44 +00:00
|
|
|
name: internal_pass2_image
|
|
|
|
- name: Extract pass2_image
|
|
|
|
run: tar -xf pass2_image.tar
|
2023-12-25 10:04:18 +00:00
|
|
|
- name: Query cache for sources
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
path: |
|
2023-12-25 10:09:51 +00:00
|
|
|
distfiles
|
2023-12-25 10:04:18 +00:00
|
|
|
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: |
|
2023-12-25 10:09:51 +00:00
|
|
|
distfiles
|
2023-12-25 10:04:18 +00:00
|
|
|
key: cache-${{ hashFiles('steps/*/sources') }}
|
2023-05-02 23:48:40 +01:00
|
|
|
- name: Run bootstrap
|
2023-12-26 03:28:47 +00:00
|
|
|
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3
|
2023-03-15 06:46:11 +00:00
|
|
|
- name: Archive created packages
|
2023-12-25 21:41:44 +00:00
|
|
|
if: always() # archive both failed and successful builds
|
2023-03-15 06:46:11 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: packages
|
2023-12-26 03:28:47 +00:00
|
|
|
path: target/external/repo/**
|