Skip to content

Test distributions build system #81

Test distributions build system

Test distributions build system #81

Workflow file for this run

name: Test distros build system
on:
workflow_dispatch:
schedule:
- cron: "0 22 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare-matrix:
name: Prepare matrix with distro install parameters
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.distros.outputs.matrix }}
steps:
- name: Checkout linuxloops source code
uses: actions/checkout@v4
- name: Create build matrix
id: distros
run: |
distros=$(sudo bash linuxloops --list | grep '" distribution:' | sed 's@"\| distribution:@@g')
for i in $distros; do
arg1=''
arg2=''
arg3=''
arg4=''
arg5=''
distro="$i"
env=$(sudo bash linuxloops --list | grep -A4 "\"$i\"" | grep 'Available desktops:' | sed 's@"\|Available desktops: @@g' | sed 's@None @@g' | sed 's@ @\n@g' | sed -e 's@\t@@g' | sort -R | head -1)
if sudo bash linuxloops --list | grep -A4 "\"$i\"" | grep -q 'Install on btrfs filesystem possible: Yes' && [ $(($RANDOM % 2)) -eq 1 ]; then arg1='-b'; fi
if sudo bash linuxloops --list | grep -A4 "\"$i\"" | grep -q 'Nvidia proprietary driver installation possible: Yes' && [ $(($RANDOM % 2)) -eq 1 ]; then arg2='-n'; fi
if sudo bash linuxloops --list | grep -A4 "\"$i\"" | grep -q 'Surface patches installation possible: Yes' && [ $(($RANDOM % 2)) -eq 1 ]; then arg3='-S'; fi
if [ "${i}" != "BlissOS" ] && [ "${i}" != "Brunch" ] && [ "${i}" != "ChromeOS-Flex" ] && [ "${i}" != "Tails" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg4='-z 2'; fi
if [ "${i}" != "BlissOS" ] && [ "${i}" != "Brunch" ] && [ "${i}" != "ChromeOS-Flex" ] && [ "${i}" != "Tails" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg5='-e'; fi
if [ -z "$matrix" ]; then matrix="\"$distro#$env#$arg1#$arg2#$arg3#$arg4#$arg5\""; else matrix="$matrix,\"$distro#$env#$arg1#$arg2#$arg3#$arg4#$arg5\""; fi
done
echo "matrix=[$matrix]" >> $GITHUB_OUTPUT
build-distros:
name: Build distro
needs: prepare-matrix
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
distro: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
- name: Display disk space
run: |
echo "Free space:"
df -h
- name: Checkout linuxloops source code
uses: actions/checkout@v4
- name: Launch distro build
run: sudo bash linuxloops -dst test.img -t -s 40 -distro $(echo ${{ matrix.distro }} | cut -d'#' -f1) -env $(echo ${{ matrix.distro }} | cut -d'#' -f2) $(echo ${{ matrix.distro }} | cut -d'#' -f3) $(echo ${{ matrix.distro }} | cut -d'#' -f4) $(echo ${{ matrix.distro }} | cut -d'#' -f5) $(echo ${{ matrix.distro }} | cut -d'#' -f6) $(echo ${{ matrix.distro }} | cut -d'#' -f7)