Skip to content

Commit

Permalink
CI: test-quickget
Browse files Browse the repository at this point in the history
  • Loading branch information
zen0bit committed May 3, 2024
1 parent 73b0dc9 commit 54dd1e3
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 140 deletions.
140 changes: 0 additions & 140 deletions .github/workflows/quickget-tests.yml

This file was deleted.

129 changes: 129 additions & 0 deletions .github/workflows/test-quickget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: "Test quickget 🧪"

on:
workflow_dispatch:
push:
branches: '**'
paths:
- quickget
pull_request:
branches: '**'
paths:
- quickget
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
list-all-supported:
name: List all supported OS 📝
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: List all supported OS variants
run: |
mkdir -p results
./quickget --list | tee -a results/supported.txt
echo -e "\nAll supported OS variants: $(wc -l results/supported.txt)"
- uses: actions/upload-artifact@v4
with:
name: supported
path: results/supported.txt
retention-days: 1

list-all-info:
name: List all OS info ℹ️
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Show info about all OS
run: |
export TERM=xterm
mkdir -p results
distros=$(./quickget | sed '/^$/q' | tail -n +3)
for os in ${distros}; do
echo -e "\n\n ${os}" && ./quickget -12345 "${os}" | tee -a results/infos.txt
done
echo -e "\nOS info: $(grep -c "http" results/infos.txt)"
- uses: actions/upload-artifact@v4
with:
name: infos
path: results/infos.txt
retention-days: 1

list-all-urls:
needs: [list-all-supported]
name: List all URLs 🔗
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: List all supported systems download URLs
run: |
export TERM=xterm
mkdir -p results
./quickget -u | tee -a url.txt
sort < url.txt > results/urls.txt
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: results
run: |
ls -R results/
FOUND=$(grep -c 'http' < results/urls.txt)
ALL=$(wc -l < results/supported.txt)
echo -e "$FOUND/$ALL"
- uses: actions/upload-artifact@v4
with:
name: urls
path: results/urls.txt

check-all-urls:
name: Check all image URLs 💿️
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Checking if all downloads for Operating Systems are available
run: |
export TERM=xterm
mkdir -p results
./quickget --check | tee -a check.txt
cat check.txt | sort > results/checks.txt
GOOD=$(grep -c 'http' results/checks.txt)
WINDOWS=$(grep -c 'windows' results/checks.txt)
ALL=$((GOOD + WINDOWS))
FAILED=$(grep -c 'FAIL:' results/checks.txt)
SKIPPED=$(grep -c 'SKIP:' results/checks.txt)
PASSED=$(grep -c 'PASS:' results/checks.txt)
CHECKED=$((FAILED + SKIPPED + PASSED))
echo -e "\nFAILED: $FAILED"
echo "SKIPPED: $SKIPPED"
echo "PASSED: $PASSED"
echo "$CHECKED/$ALL with skipped Windows"
echo -e "Failed:\n$(grep 'FAIL:' results/checks.txt | tee -a results/failed.txt)"
- uses: actions/upload-artifact@v4
with:
name: checks
path: results/checks.txt
- uses: actions/upload-artifact@v4
with:
name: failed
path: results/failed.txt

upload-artifacts:
needs: [list-all-info, list-all-urls, check-all-urls]
name: Uploading artifacts
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: results
run: |
ls -R results/
- uses: actions/upload-artifact@v4
with:
overwrite: true
name: results
path: results/

0 comments on commit 54dd1e3

Please sign in to comment.