CI: test-quickget

This commit is contained in:
zen0bit 2024-05-03 10:18:05 +02:00
parent 2f3eb67b6e
commit e2aaacb3a7
2 changed files with 27 additions and 168 deletions

View File

@ -1,140 +0,0 @@
--- # This is a basic workflow to help test quickget
name: quickget tests
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Build at 00:00 on every 12th day-of-month.
#schedule:
# - cron: "0 0 */12 * *"
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: '**' #'!master' # excludes master
paths: [ quickget ]
pull_request:
branches: '**' # matches every branch
paths:
- quickget
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
job1:
name: All supported
runs-on: ubuntu-latest
# The type of runner that the job will run on
#runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: List all supported OS variants
run: |
mkdir -p results
echo -e "\n\n Supported:\n\n"
./quickget -l | tee results/supported.txt
echo -e "\n\nAll supported OS variants: $(cat results/supported.txt | wc -l)"
echo -e "\n\n Finished\n\n"
- uses: actions/upload-artifact@v4
with:
name: supported
path: results/supported.txt
job2:
name: All info
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Show info about all OS
run: |
export TERM=xterm-256color
#sudo apt install -y neofetch
#echo -e "\n\n"
#neofetch
#echo -e "\n\n"
echo -e "\n\n OSinfo:\n\n"
distros="$(./quickget | sed '/^$/q' | tail -n +3)"
mkdir -p results
for os in ${distros}; do
echo -e "\n\n ${os}" && ./quickget -12345 "${os}" | tee -a results/infos.txt
done
echo -e "\n\nHomepages aka number of supported OS (os_info): $(cat results/infos.txt | grep 'http' | wc -l)"
echo -e "\n\n Finished\n\n"
- uses: actions/upload-artifact@v4
with:
name: infos
path: results/infos.txt
job3:
needs: [job1]
name: All URLs
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: Display downloaded artifacts
run: ls -R results/
- uses: actions/checkout@v4
- name: List all supported systems download URLs
run: |
export TERM=xterm-256color
distros="$(./quickget | sed '/^$/q' | tail -n +3)"
echo -e "\n\n ISOs:\n\n"
mkdir -p results
for os in ${distros}; do
echo -e "\n\n ${os}" && ./quickget -u "${os}" | tee -a results/urls.txt
done
echo -e "\n\nFounded/All URLs: $(cat results/urls.txt | grep 'http' | wc -l)/$(cat results/supported.txt | wc -l)"
echo -e "\n\n Finished\n\n"
- uses: actions/upload-artifact@v4
with:
name: urls
path: results/urls.txt
job4:
name: All checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checking if all downloads for Operating Systems are available...
run: |
export TERM=xterm-256color
distros="$(./quickget | sed '/^$/q' | tail -n +3)"
echo -e "\n\n ISOs availability:\n\n"
mkdir -p results
for os in ${distros}; do
echo -e "\n\n ${os}" && ./quickget -c "${os}" | tee -a results/checks.txt
done
ALL=$(cat results/checks.txt | grep 'http' | wc -l)
FAILED=$(grep -c 'FAIL:' results/checks.txt)
SKIPED=$(grep -c 'SKIP:' results/checks.txt)
PASSED=$(grep -c 'PASS:' results/checks.txt)
CHECKED=$(($FAILED + $SKIPED + $PASSED))
echo -e "\n\nFAILED: $FAILED"
echo "SKIPED: $SKIPED"
echo "PASSED: $PASSED"
echo "All/Checked: $ALL/$CHECKED"
echo -e "Failed:\n$(grep 'FAIL:' results/checks.txt | tee -a results/failed.txt)"
echo -e "\n\n Finished\n\n"
- uses: actions/upload-artifact@v4
with:
name: checks
path: results/checks.txt
- uses: actions/upload-artifact@v4
with:
name: failed
path: results/failed.txt

View File

@ -4,45 +4,41 @@ on:
workflow_dispatch:
push:
branches: '**'
paths: [ quickget ]
paths:
- quickget
pull_request:
branches: '**'
paths: [ quickget ]
paths:
- quickget
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
list-all-supported:
name: "List all supported OS 📝"
name: Supported OS 📝
runs-on: ubuntu-22.04
# The type of runner that the job will run on
#runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: "List all supported OS variants"
- name: Supported OS variants
run: |
mkdir -p results
./quickget --list | tee results/supported.txt
echo -e "\nResults:"
echo "- All supported OS variants: $(wc -l results/supported.txt | cut -d' ' -f 1)"
./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: "List all OS info "
name: OS info
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Show info about all OS
run: |
export TERM=xterm-256color
export TERM=xterm
mkdir -p results
for os in $(./quickget | sed '/^$/q' | tail -n +3); do
./quickget -12345 "${os}" | tee -a results/infos.txt
@ -53,40 +49,43 @@ jobs:
with:
name: infos
path: results/infos.txt
retention-days: 1
list-all-urls:
needs: [list-all-supported]
name: "List all URLs 🔗"
name: URLs 🔗
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "quickget --url"
- name: quickget --url
run: |
export TERM=xterm-256color
export TERM=xterm
mkdir -p results
./quickget --url | tee results/urls.txt
./quickget -u | tee -a url.txt
sort < url.txt > results/urls.txt
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: "Show differences ⚖️"
- name: Differences ⚖️
run: |
echo -e "\nResults:"
echo -e "List All URLs:\t$(grep -c http results/urls.txt)"
echo -e "OS Info URLs:\t$(wc -l results/supported.txt | cut -d' ' -f 1)"
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 💿️"
name: Check URLs 💿️
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "quickget --check"
- name: quickget --check
run: |
export TERM=xterm-256color
export TERM=xterm
mkdir -p results
./quickget --check | tee results/checks.txt
WINDOWS=$(grep -c "windows-" results/checks.txt)
@ -110,14 +109,14 @@ jobs:
upload-artifacts:
needs: [list-all-info, list-all-urls, check-all-urls]
name: "Uploading artifacts"
name: Uploading
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: "List results"
- name: Results
run: |
ls -R results/
- uses: actions/upload-artifact@v4