Skip to content

Test distributions build system #418

Test distributions build system

Test distributions build system #418

Workflow file for this run

name: Test distributions 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 distributions install parameters
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.distributions.outputs.matrix }}
steps:
- name: Checkout linuxloops source code
uses: actions/checkout@v4
- name: Create build matrix
id: distributions
run: |
distributions=$(sudo bash linuxloops --list-distributions)
for distribution in $distributions; do
versions=$(sudo bash linuxloops --distribution $distribution --list-versions | sed 's@x86-64-.*@@g')
for version in $versions; do
arg1=''
arg2=''
arg3=''
arg4=''
arg5=''
arg6=''
environment=$(sudo bash linuxloops --distribution $distribution --version $version --list-environments | tr ' ' '\n' | sort -R | head -1)
if [ "$(sudo bash linuxloops --distribution $distribution --version $version --list-btrfs)" == "Yes" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg1='-b'; fi
if [ "$(sudo bash linuxloops --distribution $distribution --version $version --list-nvidia)" == "Yes" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg2='-n'; fi
if [ "$(sudo bash linuxloops --distribution $distribution --version $version --list-surface)" == "Yes" ] && [ "${arg2}" == "" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg3='-S'; fi
if [ "${distribution}" != "BlissOS" ] && [ "${distribution}" != "Brunch" ] && [ "${distribution}" != "ChimeraOS" ] && [ "${distribution}" != "ChromeOS-Flex" ] && [ "${distribution}" != "Tails" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg4='-z 2'; fi
if [ "${distribution}" != "BlissOS" ] && [ "${distribution}" != "Brunch" ] && [ "${distribution}" != "ChimeraOS" ] && [ "${distribution}" != "ChromeOS-Flex" ] && [ "${distribution}" != "Tails" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg5='-e'; fi
if [ "${distribution}" != "BlissOS" ] && [ "${distribution}" != "Brunch" ] && [ "${distribution}" != "ChimeraOS" ] && [ "${distribution}" != "ChromeOS-Flex" ] && [ "${distribution}" != "Tails" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg6='-a'; fi
if [ -z "$matrix" ]; then matrix="\"$distribution#$version#$environment#$arg1#$arg2#$arg3#$arg4#$arg5#$arg6\""; else matrix="$matrix,\"$distribution#$version#$environment#$arg1#$arg2#$arg3#$arg4#$arg5#$arg6\""; fi
done
done
echo "matrix=[$matrix]" >> $GITHUB_OUTPUT
build-distributions:
name: Build distribution
needs: prepare-matrix
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
distribution: ${{ 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 distribution build
run: sudo bash linuxloops -dst test.img -t -s 40 -distro $(echo ${{ matrix.distribution }} | cut -d'#' -f1) -ver $(echo ${{ matrix.distribution }} | cut -d'#' -f2) -env $(echo ${{ matrix.distribution }} | cut -d'#' -f3) $(echo ${{ matrix.distribution }} | cut -d'#' -f4) $(echo ${{ matrix.distribution }} | cut -d'#' -f5) $(echo ${{ matrix.distribution }} | cut -d'#' -f6) $(echo ${{ matrix.distribution }} | cut -d'#' -f7) $(echo ${{ matrix.distribution }} | cut -d'#' -f8) $(echo ${{ matrix.distribution }} | cut -d'#' -f9)