mirror of
https://github.com/theupriser/steamify-cachyos-live-iso.git
synced 2026-10-02 15:10:26 +02:00
ci: Add basic tests
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
This commit is contained in:
1 parent
b45ff015c0
commit
b4c1b8d14c
6 files changed
+378
No files matched your search
@@ -8,6 +8,8 @@ jobs:
|
||||
image: archlinux:base-devel
|
||||
options: --privileged
|
||||
name: Build
|
||||
outputs:
|
||||
builddate: ${{ steps.date.outputs.builddate }}
|
||||
steps:
|
||||
- name: Get build date
|
||||
id: date
|
||||
@@ -42,3 +44,69 @@ jobs:
|
||||
with:
|
||||
name: cachyos-desktop-linux-${{ steps.date.outputs.builddate }}
|
||||
path: out/desktop/*
|
||||
quicktest:
|
||||
name: Testing
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
container:
|
||||
image: archlinux:base-devel
|
||||
options: --privileged
|
||||
steps:
|
||||
- name: Clone CachyOS-Live-ISO
|
||||
id: clone
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
id: dependencies
|
||||
run: |
|
||||
pacman -Syu --noconfirm git ffmpeg imagemagick tesseract-data-eng qemu-desktop
|
||||
|
||||
- name: Create build user
|
||||
id: user
|
||||
run: |
|
||||
useradd builder -m
|
||||
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
chmod -R a+rw .
|
||||
|
||||
- name: Build quickemu
|
||||
id: quickemu
|
||||
run: |
|
||||
sudo -u builder git clone https://aur.archlinux.org/quickemu.git
|
||||
cd quickemu
|
||||
sudo -H -E -u builder makepkg --syncdeps --noconfirm
|
||||
pacman -U --noconfirm quickemu*.pkg.tar.zst
|
||||
cd ..
|
||||
|
||||
- name: Clone quicktest
|
||||
id: clone-quicktest
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: 'quickemu-project/quicktest'
|
||||
path: 'quicktest'
|
||||
|
||||
- name: Download ISO
|
||||
id: download
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: machines/cachyos-dailylive
|
||||
merge-multiple: true
|
||||
|
||||
- name: Run quicktest
|
||||
id: quicktest
|
||||
run: |
|
||||
./quicktest/quicktest test_install_calamares cachyos dailylive
|
||||
env:
|
||||
QT_NOTIFY: "false"
|
||||
QT_OPEN_RESULTS: "false"
|
||||
QT_QUICKGET_SKIP: "true"
|
||||
QT_TESTCASES_DIR: "./testcases"
|
||||
QUICKEMU_DISPLAY: "none"
|
||||
QUICKEMU_VM_DIR: "./machines"
|
||||
|
||||
- name: Upload results to artifacts
|
||||
id: upload-results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cachyos-desktop-linux-results-${{needs.build.outputs.builddate}}
|
||||
path: results/*
|
||||
@@ -0,0 +1,3 @@
|
||||
guest_os="linux"
|
||||
disk_img="cachyos-dailylive/disk.qcow2"
|
||||
iso="$(realpath "$(find -name "*.iso" | head -n1)")"
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
# CachyOS Calamares install
|
||||
|
||||
# Language
|
||||
|
||||
TESSERACT_LANG="eng"
|
||||
|
||||
# GRUB
|
||||
|
||||
text_console_gnu_grub="GNU GRUB"
|
||||
|
||||
# Initial splash
|
||||
|
||||
text_console_prompt_welcome="Welcome to CachyOS"
|
||||
text_console_prompt_login="localhost login"
|
||||
|
||||
# Calamares Welcome
|
||||
|
||||
text_calamares_welcome="Welcome to the CachyOS installer"
|
||||
|
||||
# Calamares Language
|
||||
|
||||
text_calamares_language="The system language will be set to"
|
||||
|
||||
# Calamares Keyboard
|
||||
|
||||
text_calamares_keyboard="Keyboard model"
|
||||
|
||||
# Calamares Bootloader
|
||||
|
||||
text_calamares_bootloader="Limine"
|
||||
|
||||
# Calamares Partitions
|
||||
|
||||
text_calamares_partitions="Select storage device"
|
||||
|
||||
# Calamares Desktop
|
||||
|
||||
text_calamares_desktop="Plasma Desktop"
|
||||
|
||||
# Calamares Packages
|
||||
|
||||
text_calamares_packages="Additional packages"
|
||||
|
||||
# Calamares Users
|
||||
|
||||
text_calamares_users="What name do you want to use to log in?"
|
||||
|
||||
# Calamares Summary
|
||||
|
||||
text_calamares_summary="This is an overview"
|
||||
|
||||
# Calamares Install
|
||||
|
||||
text_calamares_install="Continue with Installation"
|
||||
|
||||
# Calamares Finished
|
||||
|
||||
text_calamares_finished="All done"
|
||||
@@ -0,0 +1,155 @@
|
||||
# Install CachyOS daily live
|
||||
|
||||
function test_description() {
|
||||
cat << EOF
|
||||
Do a clean install of CachyOS using all the defaults
|
||||
EOF
|
||||
}
|
||||
|
||||
function test_setup() {
|
||||
test_user="cachyos"
|
||||
test_password="ILoveCandy"
|
||||
}
|
||||
|
||||
function test_post_boot_grub() {
|
||||
qt_wait_for_seconds 5
|
||||
qt_wait_for_text "$FUNCNAME" "GNU GRUB" 3 5
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
qt_send_key "return"
|
||||
}
|
||||
|
||||
function test_launch_calamares() {
|
||||
qt_wait_for_text "$FUNCNAME" "Welcome to CachyOS!" 3 60
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
qt_send_key_combo "alt-f2"
|
||||
qt_wait_for_seconds 2
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
qt_send_string_tab "CALAMARES_SKIP_GEOIP=1 sudo -E dbus-launch calamares -D6"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
qt_wait_for_text "$FUNCNAME" "CALAMARES_SKIP_GEOIP=1 sudo -E dbus-launch calamares -D6" 3 3
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key "return"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
qt_wait_for_seconds 20
|
||||
}
|
||||
|
||||
function test_calamares_welcome() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_welcome" 10 5
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "spc"
|
||||
}
|
||||
|
||||
function test_calamares_location() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_language" 10 5
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "spc"
|
||||
}
|
||||
|
||||
function test_calamares_keyboard() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_keyboard" 10 5
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_bootloader() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_bootloader" 10 5
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_partitions() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_partitions" 10 5
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "spc"
|
||||
qt_send_key_combo "shift-tab"
|
||||
qt_send_key_combo "shift-tab"
|
||||
qt_send_key_combo "shift-tab"
|
||||
qt_send_key_combo "shift-tab"
|
||||
qt_send_key_combo "shift-tab"
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_desktop() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_desktop" 10 5
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_packages() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_packages" 10 5
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_users() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_users" 10 5
|
||||
qt_send_string_tab "$test_user"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_string_tab "$test_password"
|
||||
qt_send_string_tab "$test_password"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "tab"
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_summary() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_summary" 10 5
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_install() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_install" 10 30
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_calamares_finished() {
|
||||
qt_wait_for_text "$FUNCNAME" "$text_calamares_finished" 30 60
|
||||
qt_send_key_combo "spc"
|
||||
qt_screenshot_ppm "$FUNCNAME"
|
||||
}
|
||||
|
||||
function test_power_off_vm() {
|
||||
qt_poweroff_vm
|
||||
}
|
||||
|
||||
function test_install_calamares() {
|
||||
test_setup
|
||||
test_post_boot_grub
|
||||
test_launch_calamares
|
||||
test_calamares_welcome
|
||||
test_calamares_location
|
||||
test_calamares_keyboard
|
||||
test_calamares_bootloader
|
||||
test_calamares_partitions
|
||||
test_calamares_desktop
|
||||
test_calamares_packages
|
||||
test_calamares_users
|
||||
test_calamares_summary
|
||||
test_calamares_install
|
||||
test_calamares_finished
|
||||
test_power_off_vm
|
||||
}
|
||||
|
||||
test_description
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# This test merely loops forever, taking a screenshot when asked
|
||||
|
||||
function test_description() {
|
||||
cat << EOF
|
||||
This test merely loops forever, taking a screenshot when asked
|
||||
The goal of this is for you to manually run the distro or release you wish to test,
|
||||
and press [return] in the terminal window, whenever you wish to take a screenshot.
|
||||
This script will take a screenshot, and then wait for you to press [return] again.
|
||||
After taking the screeshot, it will run tesseract to turn the image into text.
|
||||
This is useful if you wish to gather screenshots and text for a new distro, or
|
||||
release, or language. You can then use this text to create a new test script.
|
||||
EOF
|
||||
}
|
||||
|
||||
function test_setup() {
|
||||
# Settings we choose to override here
|
||||
QT_KEEP_SCREENSHOTS=true
|
||||
QT_KEEP_TESSERACT_TEXT=true
|
||||
|
||||
# Set the language to test
|
||||
# Be sure to install the relavent tesseract language pack
|
||||
# e.g. tesseract-ocr-fra
|
||||
TESSERACT_LANG="eng"
|
||||
}
|
||||
|
||||
function test_loop_gathering_screenshots_and_text() {
|
||||
qt_screenshot_ppm notest
|
||||
qt_ocr_only notest
|
||||
qt_wait_for_host_keypress
|
||||
}
|
||||
|
||||
function test_no_test_gather_screenshots_and_text_only() {
|
||||
# Loop forever
|
||||
while true; do
|
||||
test_loop_gathering_screenshots_and_text
|
||||
done
|
||||
}
|
||||
|
||||
test_description
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
# English (US) key mappings for sendkey
|
||||
|
||||
KEYS+=(
|
||||
["\`"]=grave
|
||||
["~"]=shift-grave
|
||||
["!"]=shift-1
|
||||
["@"]=shift-2
|
||||
["#"]=shift-3
|
||||
["$"]=shift-4
|
||||
["%"]=shift-5
|
||||
["^"]=shift-6
|
||||
["&"]=shift-7
|
||||
["*"]=shift-8
|
||||
["("]=shift-9
|
||||
[")"]=shift-0
|
||||
["-"]=minus
|
||||
["_"]=shift-minus
|
||||
["="]=equal
|
||||
["+"]=shift-equal
|
||||
["["]=bracketleft
|
||||
["{"]=shift-bracketleft
|
||||
["]"]=bracketright
|
||||
["}"]=shift-bracketright
|
||||
["\\"]=backslash
|
||||
["|"]=shift-backslash
|
||||
[";"]=semicolon
|
||||
[":"]=shift-semicolon
|
||||
["'"]=apostrophe
|
||||
["@"]=shift-apostrophe
|
||||
[","]=comma
|
||||
["<"]=shift-comma
|
||||
[">"]=shift-period
|
||||
["/"]=slash
|
||||
["?"]=shift-slash
|
||||
["."]=dot
|
||||
[" "]=spc
|
||||
["enter"]=ret
|
||||
["return"]=ret
|
||||
["escape"]=esc
|
||||
["esc"]=esc
|
||||
["tab"]=tab
|
||||
)
|
||||
|
||||
for letter in {a..z}; do
|
||||
KEYS+=(
|
||||
["$letter"]=$letter
|
||||
["${letter^^}"]=shift-$letter
|
||||
)
|
||||
done
|
||||
|
||||
for number in {0..9}; do
|
||||
KEYS+=(
|
||||
["$number"]=$number
|
||||
)
|
||||
done
|
||||
Reference in new issue
Block a user