2025-01-19 13:20:27 -08:00
|
|
|
name: Test
|
2024-10-12 22:31:21 -07:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
workflow_dispatch:
|
2025-01-20 11:28:55 -08:00
|
|
|
pull_request:
|
2024-10-12 22:31:21 -07:00
|
|
|
|
|
|
|
jobs:
|
2025-01-20 18:12:08 -08:00
|
|
|
syntax:
|
|
|
|
name: Check syntax
|
2025-01-20 18:47:53 -08:00
|
|
|
runs-on: alpine
|
2025-01-20 18:12:08 -08:00
|
|
|
steps:
|
2025-01-20 18:47:53 -08:00
|
|
|
- uses: https://git.swee.codes/swee/setup-alpine@main
|
|
|
|
with:
|
|
|
|
additional: python3 libxml2-utils
|
2025-01-20 18:12:08 -08:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check syntax of Python file
|
|
|
|
run: python3 -m py_compile sweecrypt-gtk.py
|
|
|
|
- name: Check syntax of XML file
|
|
|
|
run: xmllint --format sweecrypt-gtk.ui
|
2025-01-19 13:20:27 -08:00
|
|
|
x11:
|
|
|
|
name: Test the application
|
2025-01-20 18:47:53 -08:00
|
|
|
runs-on: alpine
|
2025-01-20 18:12:08 -08:00
|
|
|
needs: syntax
|
2025-01-19 13:20:27 -08:00
|
|
|
steps:
|
2025-01-20 18:47:53 -08:00
|
|
|
- uses: https://git.swee.codes/swee/setup-alpine@main
|
|
|
|
with:
|
2025-01-20 19:10:13 -08:00
|
|
|
additional: tigervnc py3-gobject3 py3-xdg py3-pip gtk+3.0 apk-gtk3 openbox scrot font-noto-all
|
2025-01-19 13:20:27 -08:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
2025-01-20 18:47:53 -08:00
|
|
|
run: pip install --break-system-packages sweecrypt
|
2025-01-19 13:39:54 -08:00
|
|
|
- name: Set VNC password
|
2025-01-19 13:54:04 -08:00
|
|
|
run: echo -e "sweecrypt\nsweecrypt\n" | vncpasswd
|
2025-01-19 13:20:27 -08:00
|
|
|
- name: Start an X11 server
|
2025-01-19 13:39:54 -08:00
|
|
|
run: USER=root vncserver :5 &
|
2025-01-19 13:20:27 -08:00
|
|
|
- name: Start the app
|
|
|
|
run: DISPLAY=:5 python3 sweecrypt-gtk.py &
|
|
|
|
- name: Wait 5 secs
|
|
|
|
run: sleep 5
|
|
|
|
- name: Take a screenshot
|
2025-01-19 14:06:26 -08:00
|
|
|
run: DISPLAY=:5 scrot screenshot.png
|
2025-01-19 13:20:27 -08:00
|
|
|
- name: Upload screenshot
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2025-01-19 14:06:26 -08:00
|
|
|
path: screenshot.png
|
2024-12-26 20:58:23 -08:00
|
|
|
apt:
|
|
|
|
name: Build Debian Package
|
2025-01-18 18:21:06 -08:00
|
|
|
runs-on: docker
|
2025-01-20 18:12:08 -08:00
|
|
|
needs: syntax
|
2024-10-12 22:31:21 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
2024-10-12 22:56:44 -07:00
|
|
|
- name: Generate DEB
|
2024-10-12 22:31:21 -07:00
|
|
|
run: |
|
2025-01-18 18:21:06 -08:00
|
|
|
python3 generate-deb.py
|
2024-12-18 15:44:30 -08:00
|
|
|
- uses: actions/upload-artifact@v3
|
2024-10-12 22:58:09 -07:00
|
|
|
with:
|
2025-01-19 12:55:58 -08:00
|
|
|
path: sweecrypt-gtk.deb
|