From 6a7ba348a4239939c804e9f22abc7791e225543d Mon Sep 17 00:00:00 2001 From: zenobit Date: Sun, 26 Jan 2025 18:21:01 +0100 Subject: [PATCH] Update test-distros.yml --- .github/workflows/test-distros.yml | 50 ++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-distros.yml b/.github/workflows/test-distros.yml index ea60fdad0a..739a48f499 100644 --- a/.github/workflows/test-distros.yml +++ b/.github/workflows/test-distros.yml @@ -23,28 +23,60 @@ jobs: runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} + supported: ${{ steps.list-supported.outputs.supported }} + steps: - name: "Check out repository" uses: actions/checkout@v4 - - name: "Generate Matrix" - id: set-matrix + - name: "Install dependencies 📦️" + run: | + sudo apt-get -y update || apt-get -y update + sudo apt-get -y install gawk curl jq qemu-system-x86 qemu-utils zsync || apt-get -y install gawk curl jq qemu-system-x86 qemu-utils zsync + + - name: "list files" run: | ls ./ + + - name: "make quickget executable" + run: | + chmod +x quickget + + - name: "quickget version" + run: | + ./quickget --version + + - name: "create dir" + run: | mkdir -p results - ./quickget | awk 'NR==3,/zorin/' | tr ' ' '\n' | tee results/testing.list - SUPPORTED=$(./quickget | awk 'NR==3,/zorin/' | tr ' ' '\n') + + - name: "show supported" + run: | + ./quickget | awk 'NR==3,/zorin/' | tr ' ' '\n' | jq -R . | jq -s . > results/supported.json + + - name: "variable" + id: list-supported + run: | + SUPPORTED=$(cat results/supported.json) + echo "supported=$SUPPORTED" >> $GITHUB_OUTPUT + + - name: "display supported" + run: | + cat results/supported.json + + - name: "Generate Matrix" + id: set-matrix + run: | MATRIX="{\"include\": [" - for os in $SUPPORTED; do + for os in $supported; do MATRIX+="{\"os\": \"$os\"}," done MATRIX="${MATRIX%,}]}" - echo "Generated Matrix: $MATRIX" + #echo "Generated Matrix: $MATRIX" echo "matrix=$MATRIX" >> $GITHUB_OUTPUT - - name: "Display Matrix" + - name: "display Matrix" run: | - echo "Matrix:" echo "${{ steps.set-matrix.outputs.matrix }}" run-actions: @@ -53,7 +85,7 @@ jobs: runs-on: ubuntu-22.04 strategy: fail-fast: false - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + matrix: ${{ fromJson(needs.set-matrix.outputs.matrix) }} steps: - name: "Check out repository" uses: actions/checkout@v4