use a test matrix

This commit is contained in:
MaxHearnden 2024-09-14 15:09:32 +01:00
parent fc2c576dde
commit dc5a00c94f

View file

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Run under bubblewrap
name: Run under (bubble)wrap
on:
workflow_dispatch:
@ -13,10 +13,15 @@ on:
jobs:
pass1:
name: Run up to Linux build under bubblewrap
name: Run up to Linux build under (bubble)wrap
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
virt-tool: [bwrap, wrap]
steps:
- name: Install bubblewrap
if: matrix.virt-tool == 'bwrap'
run: sudo apt install bubblewrap
- name: Checkout repo
uses: actions/checkout@v3
@ -43,7 +48,7 @@ jobs:
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1
run: ./rootfs.py --${{matrix.virt-tool}} --external-sources --build-kernels --cores 2 --internal-ci pass1
- name: Archive created packages
if: failure() # archive failed builds progress
uses: actions/upload-artifact@v3
@ -56,14 +61,19 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: internal_pass1_image
path: pass1_image.tar
path: pass1_image_${{matrix.virt-tool}}.tar
pass2:
name: Run up to Python bootstrap under bubblewrap
name: Run up to Python bootstrap under (bubble)wrap
needs: pass1
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
virt-tool: [bwrap, wrap]
steps:
- name: Install bubblewrap
if: matrix.virt-tool == 'bwrap'
run: sudo apt install bubblewrap
- name: Checkout repo
uses: actions/checkout@v3
@ -77,7 +87,7 @@ jobs:
with:
name: internal_pass1_image
- name: Extract pass1_image
run: tar -xf pass1_image.tar
run: tar -xf pass1_image_${{matrix.virt-tool}}.tar
- name: Query cache for sources
id: cache
uses: actions/cache/restore@v3
@ -96,7 +106,7 @@ jobs:
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2
run: ./rootfs.py --${{matrix.virt-tool}} --external-sources --build-kernels --cores 2 --internal-ci pass2
- name: Archive created packages
if: failure() # archive failed builds progress
uses: actions/upload-artifact@v3
@ -109,14 +119,19 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: internal_pass2_image
path: pass2_image.tar
path: pass2_image_${{matrix.virt-tool}}.tar
pass3:
name: Run remaining builds under bubblewrap
name: Run remaining builds under (bubble)wrap
needs: pass2
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
virt-tool: [bwrap, wrap]
steps:
- name: Install bubblewrap
if: matrix.virt-tool == 'bwrap'
run: sudo apt install bubblewrap
- name: Checkout repo
uses: actions/checkout@v3
@ -130,7 +145,7 @@ jobs:
with:
name: internal_pass2_image
- name: Extract pass2_image
run: tar -xf pass2_image.tar
run: tar -xf pass2_image_${{matrix.virt-tool}}.tar
- name: Query cache for sources
id: cache
uses: actions/cache/restore@v3
@ -149,10 +164,10 @@ jobs:
distfiles
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Run bootstrap
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3
run: ./rootfs.py --${{matrix.virt-tool}} --external-sources --build-kernels --cores 2 --internal-ci pass3
- name: Archive created packages
if: always() # archive both failed and successful builds
uses: actions/upload-artifact@v3
with:
name: packages
name: packages_${{matrix.virt-tool}}
path: target/external/repo/**