Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests CI and refactor release workflow #1155

Merged
merged 25 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2092f24
fix: correct help_message() for -ca -ua; make OS optional
zen0bit Apr 29, 2024
cbc64b2
ci: add quickget tests to github actions. closes #1153
zen0bit Apr 30, 2024
a4fdcbd
ci: count lines and output counts in the logs
zen0bit Apr 30, 2024
e8245ab
ci: save failed.txt and compare URLs/All supported
zen0bit Apr 30, 2024
f1263e1
ci: remove obsolete -ca and -ua arguments. closes #1146
flexiondotorg May 2, 2024
06c7c53
ci: Improve quickget tests
zen0bit Apr 30, 2024
8eae7de
ci: misc fixes
zen0bit May 2, 2024
ff749f8
refactor: update help_message(). closes #1148
zen0bit May 2, 2024
9d8c935
style: update usage/help for quickemu and quickget
flexiondotorg May 3, 2024
886da44
ci: update publish-flakehub.yml
flexiondotorg May 3, 2024
d64b075
ci: run all tests on ubuntu-22.04
flexiondotorg May 3, 2024
b4fe452
ci :remove obsolete neofetch install
flexiondotorg May 3, 2024
8aff0a9
ci :update quickget-tests job names
flexiondotorg May 3, 2024
81bf228
ci: update workflow names
flexiondotorg May 3, 2024
cd091ea
ci: use quickget long arguments for readability
flexiondotorg May 3, 2024
b7c29dd
style: white space clean up
flexiondotorg May 3, 2024
db2bf56
ci :rename workflows
flexiondotorg May 3, 2024
47c62c0
fix: exit the tests correctly
flexiondotorg May 3, 2024
6a9547f
ci: refactor publish-release.yml
flexiondotorg May 3, 2024
310d3e0
refactor: update lint-shellcheck to use ludeeus/action-shellcheck. cl…
flexiondotorg May 3, 2024
733ea48
ci: fix upload-artifacts. closes #1154
flexiondotorg May 3, 2024
2082406
ci: add version checking to publish-release.yml. close #1128
flexiondotorg May 3, 2024
24088a7
ci: retain test result for default period
flexiondotorg May 3, 2024
8271d71
style: white space clean up in test-quickget.yml
flexiondotorg May 3, 2024
4209f68
refactor: update and simplify test-quickget.yml
flexiondotorg May 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/workflows/flakehub-publish.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/lint-shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Lint Shellcheck 🐚"

on:
pull_request:
branches: '**'
workflow_dispatch:

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
format: gcc
severity: error
36 changes: 0 additions & 36 deletions .github/workflows/publish-ppa.yml

This file was deleted.

93 changes: 86 additions & 7 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
name: Build 🏗️ and Publish 📦
name: Publish Release 🏷

on:
push:
tags: ['*']
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
tag:
description: "The existing tag to publish"
type: "string"
required: true

jobs:
create-release:
name: Create Release
version-check:
name: "Check versions ⚖️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Compare App and Git versions 🟰"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
APP_VERSION=$(grep "^readonly VERSION" quickemu | cut -d'"' -f2)
GIT_VERSION=$(git describe --tags | cut -d'-' -f1)
echo "App version: ${REL_VERSION}"
echo "Git version: ${GIT_VERSION}"
if [ "${APP_VERSION}" != "${GIT_VERSION}" ]; then
echo "ERROR! Version mismatch.";
exit 1
fi

draft-release:
needs: [version-check]
name: "Draft Release 📥️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -17,8 +45,8 @@ jobs:
gh release create "${{ github.ref }}" --draft --generate-notes

build-release:
needs: [create-release]
name: Build Release
needs: [draft-release]
name: "Build Release 👨‍🔧"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -36,7 +64,7 @@ jobs:

publish-release:
needs: [build-release]
name: Publish Release
name: "Publish Release 📤️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -48,3 +76,54 @@ jobs:
exit 1
fi
gh release edit "${{ github.ref }}" --draft=false

publish-flakehub:
needs: [version-check]
name: "Publish FlakeHub ❄️"
runs-on: "ubuntu-22.04"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v4"
with:
ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/magic-nix-cache-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
visibility: "public"
name: "quickemu-project/quickemu"
tag: "${{ inputs.tag }}"

publish-ppa:
needs: [version-check]
name: "Publish PPA 📦️"
runs-on: ubuntu-22.04
steps:
- name: "Checkout 🥡"
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Import gpg key 🔑"
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
- name: "Install dependencies 💾"
run: |
sudo apt-get -y update
sudo apt-get -y install debhelper-compat distro-info dput devscripts
- name: "Upload to PPA ⤴️"
env:
DEBEMAIL: ${{ secrets.DEBEMAIL }}
DEBFULLNAME: ${{ secrets.DEBFULLNAME }}
run: |
REL_VER=$(grep "^readonly VERSION" quickemu | cut -d'"' -f2)
STAMP=$(date +%y%j.%H%M)
for CODENAME in $(distro-info --supported); do
rm debian/changelog
dch --package quickemu --newversion="${REL_VER}-1~${CODENAME}${STAMP}" --distribution=${CODENAME} "New upstream release." --create
dpkg-buildpackage -d -S -sa
dput ppa:flexiondotorg/quickemu ../quickemu_${REL_VER}-1~${CODENAME}${STAMP}_source.changes
done
29 changes: 0 additions & 29 deletions .github/workflows/reviewdog.yml

This file was deleted.

127 changes: 127 additions & 0 deletions .github/workflows/test-quickget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
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

# 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 📝"
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"
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)"
- uses: actions/upload-artifact@v4
with:
name: supported
path: results/supported.txt

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-256color
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

list-all-urls:
needs: [list-all-supported]
name: "List all URLs 🔗"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "quickget --url"
run: |
export TERM=xterm-256color
mkdir -p results
./quickget --url | tee results/urls.txt
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: "Show 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)"
- 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: "quickget --check"
run: |
export TERM=xterm-256color
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 artifacts"
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: "List results"
run: |
ls -R results/
- uses: actions/upload-artifact@v4
with:
overwrite: true
name: results
path: results/
14 changes: 12 additions & 2 deletions quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -1385,11 +1385,21 @@ EOF
}

function usage() {
echo " _ _"
echo " __ _ _ _(_) ___| | _____ _ __ ___ _ _"
echo " / _' | | | | |/ __| |/ / _ \ '_ ' _ \| | | |"
echo "| (_| | |_| | | (__| < __/ | | | | | |_| |"
echo " \__, |\__,_|_|\___|_|\_\___|_| |_| |_|\__,_|"
echo " |_| v${VERSION}, using qemu ${QEMU_VER_LONG}"
echo "--------------------------------------------------------------------------------"
echo " Project - https://github.com/quickemu-project/quickemu"
echo " Discord - https://wimpysworld.io/discord"
echo "--------------------------------------------------------------------------------"
echo
echo "Usage"
echo " ${LAUNCHER} --vm ubuntu.conf [optional params]"
echo " ${LAUNCHER} --vm ubuntu.conf <arguments>"
echo
echo "List of optional parameters:"
echo "Arguments"
echo " --access : Enable remote spice access support. 'local' (default), 'remote', 'clientipaddress'"
echo " --braille : Enable braille support. Requires SDL."
echo " --delete-disk : Delete the disk image and EFI variables"
Expand Down
Loading
Loading