Skip to content

Commit

Permalink
Create dynamic.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zen0bit committed Jan 11, 2025
1 parent b10a120 commit 238574d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/dynamic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Test dynamic 🧪"

on:
workflow_dispatch:
push:
pull_request:
branches:
- '**'

jobs:
generate-matrix:
name: "Generate Matrix Configuration"
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.generate.outputs.matrix }}

steps:
- uses: actions/checkout@v4
- name: "Install dependencies 📦️"
run: sudo apt-get -y update && sudo apt-get -y install jq

- name: "Generate OS matrix 📃"
id: generate
run: |
./quickget | awk 'NR==2,/zorin/' | cut -d':' -f2 | grep -o '[^ ]*' | tail -n +2 | jq -R -s -c 'split("\n")[:-1] | map({os: .})' > matrix.json
cat matrix.json
echo "::set-output name=matrix::$(cat matrix.json)"
- name: Debug generated matrix
run: cat matrix.json

testing:
name: "Test"
needs: generate-matrix
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}

steps:
- uses: actions/checkout@v4
- name: "Install dependencies 📦️"
run: sudo apt-get -y update && sudo apt-get -y install curl qemu-utils jq

- name: "Check ${{ matrix.config.os }} downloads 💿️"
run: |
mkdir -p results
./quickget --check ${{ matrix.config.os }} > results/${{ matrix.config.os }}.txt
- name: "Display results 📊"
run: cat results/${{ matrix.config.os }}.txt

0 comments on commit 238574d

Please sign in to comment.