This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "🧪 supported OS" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
# paths: | |
# - quickget | |
pull_request: | |
branches: | |
- '**' | |
# paths: | |
# - quickget | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
generate-matrix: | |
name: "Generate Matrix" | |
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: "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 | |
- name: "show supported" | |
run: | | |
./quickget | awk 'NR==3,/zorin/' | tr ' ' '\n' | tee results/supported.list | |
- name: "variable" | |
id: list-supported | |
run: | | |
SUPPORTED=$(cat results/supported.list) | |
echo "supported=$SUPPORTED" >> $GITHUB_OUTPUT | |
- name: "display supported" | |
run: | | |
echo "${{ steps.list-supported.outputs.supported }}" | |
- name: "Generate Matrix" | |
id: set-matrix | |
run: | | |
MATRIX="{\"include\": [" | |
for os in ${{ steps.list-supported.outputs.supported }}; do | |
MATRIX+="{\"os\": \"$os\"}," | |
done | |
MATRIX="${MATRIX%,}]}" | |
#echo "Generated Matrix: $MATRIX" | |
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT | |
- name: "display Matrix" | |
run: | | |
echo "${{ steps.set-matrix.outputs.matrix }}" | |
run-actions: | |
name: "check 💿️" | |
needs: generate-matrix | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
steps: | |
- name: "Check out repository" | |
uses: actions/checkout@v4 | |
- name: "Install dependencies 📦️" | |
run: | | |
apt-get -y update | |
apt-get -y install curl qemu-utils jq | |
- name: "🔨 ${{ matrix.os }}" | |
run: | | |
mkdir -p results | |
./quickget --check ${{ matrix.os }} | tee results/${{ matrix.os }}.txt | |
if grep -vqE '^(PASS:|SKIP:)' results/${{ matrix.os }}.txt; then | |
grep -vE '^(PASS:|SKIP:)' results/${{ matrix.os }}.txt >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
fi |