quickemu/.github/workflows/dynamo.yml

67 lines
1.9 KiB
YAML

name: "Test supported Operating Systems"
on:
workflow_dispatch:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
generate-matrix:
name: "Generate Matrix"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: "Check out repository"
uses: actions/checkout@v4
- name: "Generate Matrix"
id: set-matrix
run: |
FILES=$(find actions/ -maxdepth 1 -type f -printf "%f\n" | sort)
MATRIX="{\"include\": ["
for file in $FILES; do
MATRIX+="{\"file\": \"$file\"},"
done
MATRIX="${MATRIX%,}]}"
echo "Generated Matrix: $MATRIX"
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
- name: "Install dependencies 📦️"
run: |
sudo apt-get -y update
sudo apt-get -y install curl jq
- name: "Display Matrix"
run: |
echo "Matrix:"
echo "${{ steps.set-matrix.outputs.matrix }}"
run-actions:
name: "check 💿️"
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- name: "Check out repository"
uses: actions/checkout@v4
- name: "Check out ${{ matrix.file }}"
run: |
mkdir -p results
RESULTS_FILE="results/${{ matrix.file }}.txt"
./quickget --check ${{ matrix.file }} | tee "$RESULTS_FILE"
if grep -vqE '^(PASS:|SKIP:)' "$RESULTS_FILE"; then
FAILED=$(grep -c '^FAIL:' "$RESULTS_FILE" | wc -l 2>/dev/null)
PASSED=$(grep -c '^PASS:' "$RESULTS_FILE" | wc -l 2>/dev/null)
echo "$FAILED/$PASSED 💀/🏁" >> $GITHUB_STEP_SUMMARY
grep -vE '^(PASS:|SKIP:)' "$RESULTS_FILE" >> $GITHUB_STEP_SUMMARY
exit 1
fi