-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (62 loc) · 3.73 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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: 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)