quickemu/.github/workflows/test-quickget.yml
2024-05-04 10:58:31 +02:00

127 lines
3.5 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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: Supported OS 📝
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Supported OS variants
run: |
mkdir -p results
./quickget --list | tee -a results/supported.txt
echo -e "\nSupported 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: 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
for os in $(./quickget | sed '/^$/q' | tail -n +3); do
./quickget -12345 "${os}" | tee -a results/infos.txt
done
echo -e "\nResults:"
echo -e "- OS Info URLs: $(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: URLs 🔗
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: quickget --url
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: Differences ⚖️
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 URLs 💿️
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: quickget --check
run: |
export TERM=xterm
mkdir -p results
./quickget --check | tee results/checks.txt
WINDOWS=$(grep -c "windows-" results/checks.txt)
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 "\nResults:"
echo -e "- PASSED:\t${PASSED}"
echo -e "- SKIPPED:\t${SKIPPED}\t(of which ${WINDOWS} are Windows)"
echo -e "- FAILED:\t${FAILED}\n"
grep ^FAIL results/checks.txt | tee 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
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/