diff --git a/.github/workflows/test-distros.yml b/.github/workflows/test-distros.yml new file mode 100644 index 0000000000..ff80a060fe --- /dev/null +++ b/.github/workflows/test-distros.yml @@ -0,0 +1,189 @@ +name: "Test distros ๐Ÿงช" + +on: + workflow_dispatch: + push: + # branches: + # - master + # paths: + # - quickget + pull_request: + branches: + - '**' + # paths: + # - quickget + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + list-variants: + name: "List OS variants" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: "Install dependencies ๐Ÿ“ฆ๏ธ" + run: | + sudo apt-get -y update + sudo apt-get -y install curl qemu-utils jq + + - name: "List OS variants ๐Ÿ“ƒ" + run: | + mkdir -p results + ./quickget --list | tail -n +2 | tee results/list.txt + + tests: + name: "Check ๐Ÿ’ฟ๏ธ" + runs-on: ubuntu-22.04 + container: + image: ubuntu:22.04 + env: + OS: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { os: alma } + - { os: alpine } + - { os: android } + - { os: antix } + - { os: archcraft } + - { os: archlinux } + - { os: arco } + - { os: artixlinux } + - { os: athenaos } + - { os: batocera } + - { os: bazzite } + - { os: biglinux } + - { os: blendos } + - { os: bodhi } + - { os: bunsenlabs } + - { os: cachyos } + - { os: centos-stream } + - { os: chimeralinux } + - { os: crunchbang++ } + - { os: debian } + - { os: deepin } + - { os: devuan } + - { os: dragonflybsd } + - { os: dsl } + - { os: easyos } + - { os: elementary } + - { os: endeavouros } + - { os: endless } + - { os: fedora } + - { os: freebsd } + - { os: garuda } + - { os: gentoo } + - { os: ghostbsd } + - { os: gnomeos } + - { os: guix } + - { os: haiku } + - { os: kali } + - { os: kdeneon } + - { os: kolibrios } + - { os: linuxlite } + - { os: linuxmint } + - { os: lmde } + - { os: lubuntu } + - { os: maboxlinux } + - { os: macos } + - { os: mageia } + - { os: manjaro } + - { os: mxlinux } + - { os: netboot } + - { os: netbsd } + - { os: nitrux } + - { os: nixos } + - { os: nwg-shell } + - { os: openbsd } + - { os: openindiana } + - { os: opensuse } + - { os: oraclelinux } + - { os: parrotsec } + - { os: peppermint } + - { os: popos } + - { os: porteus } + - { os: primtux } + - { os: proxmox-ve } + - { os: pureos } + - { os: reactos } + - { os: rebornos } + - { os: rockylinux } + - { os: siduction } + - { os: slackware } + - { os: slax } + - { os: slint } + - { os: slitaz } + - { os: solus } + - { os: sparkylinux } + - { os: tails } + - { os: tinycore } + - { os: trisquel } + - { os: truenas-core } + - { os: truenas-scale } + - { os: tuxedo-os } + - { os: ubuntu } + - { os: ubuntu-budgie } + - { os: ubuntu-mate } + - { os: ubuntu-server } + - { os: ubuntu-unity } + - { os: ubuntucinnamon } + - { os: ubuntukylin } + - { os: ubuntustudio } + - { os: vanillaos } + - { os: void } + - { os: vxlinux } + - { os: windows } + - { os: windows-server } + - { os: xubuntu } + - { os: zorin } + + steps: + - uses: actions/checkout@v4 + - name: "Install dependencies ๐Ÿ“ฆ๏ธ" + run: | + apt-get -y update + apt-get -y install curl qemu-utils jq + + - name: "List ${{ matrix.config.os }} variants ๐Ÿ“ƒ" + run: | + mkdir -p results + ./quickget --list | tail -n +2 | grep ${{ matrix.config.os }} | tee results/1LIST.txt + + - name: Upload list results + uses: actions/upload-artifact@v3 + with: + name: results + path: results/1LIST.txt + + - name: "Check ${{ matrix.config.os }} downloads ๐Ÿ’ฟ๏ธ" + run: | + ./quickget --check ${{ matrix.config.os }} | tee results/${{ matrix.config.os }}.txt + + - name: "Display ${{ matrix.config.os }} results ๐Ÿ“Š" + run: | + cat results/1LIST.txt | grep ${{ matrix.config.os }} + if grep -vq '^PASS:' results/${{ matrix.config.os }}.txt; then + echo "Failed checks for ${{ matrix.config.os }}:" + grep -v '^PASS:' results/${{ matrix.config.os }}.txt >> $GITHUB_STEP_SUMMARY + exit 1 + else + echo "All checks passed for ${{ matrix.config.os }}" + fi + grep ^FAIL results/${{ matrix.config.os }}.txt | tee -a results/FAILED.txt + VARIATIONS=$(cut -d' ' -f 1 < results/1LIST.txt | grep ${{ matrix.config.os }} | wc -l) + DOWNLOADS=$(wc -l results/${{ matrix.config.os }}.txt | cut -d' ' -f 1) + echo + echo "Compare OS variations with downloads:" + echo -e "- Variations:\t${VARIATIONS}" + echo -e "- Downloads:\t${DOWNLOADS}" + #cat results/${{ matrix.config.os }}.txt | grep -v 'PASS:' >> $GITHUB_STEP_SUMMARY && exit 1 || echo ":rocket:" >> $GITHUB_STEP_SUMMARY && exit 0 + + - name: Upload ${{ matrix.config.os }} results + uses: actions/upload-artifact@v3 + with: + name: results + path: results/