This commit is contained in:
@@ -16,7 +16,8 @@ on:
|
||||
env:
|
||||
WINEPREFIX: ${{ github.workspace }}/wine-prefix
|
||||
WINEPYTHON: ${{ github.workspace }}/wine-prefix/drive_c/Python312/python.exe
|
||||
XDG_RUNTIME_DIR: /tmp # Suppress harmless warning
|
||||
DISPLAY: :99.0
|
||||
WINEDLLOVERRIDES: "mscoree,mshtml=;winemenubuilder.exe=d"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -26,7 +27,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Wine & xvfb
|
||||
- name: Install Wine & Xvfb
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo mkdir -p /etc/apt/keyrings
|
||||
@@ -38,10 +39,18 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install --install-recommends winehq-stable xvfb -y
|
||||
|
||||
- name: Set up Wine prefix (headless)
|
||||
- name: Start Xvfb
|
||||
run: |
|
||||
Xvfb :99 -screen 0 1024x768x16 &
|
||||
sleep 2 # give Xvfb a moment
|
||||
|
||||
- name: Set up Wine prefix
|
||||
run: |
|
||||
mkdir -p "$WINEPREFIX"
|
||||
xvfb-run wineboot --init
|
||||
# Initialize the prefix without Mono/Gecko timeouts
|
||||
wineboot --init --update
|
||||
# Set Windows version to 10 (or your target)
|
||||
winecfg -v win10
|
||||
|
||||
- name: Download Python installer
|
||||
run: |
|
||||
@@ -49,31 +58,31 @@ jobs:
|
||||
https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe \
|
||||
-O /tmp/python.exe
|
||||
|
||||
- name: Install Python in Wine (headless)
|
||||
- name: Install Python in Wine
|
||||
run: |
|
||||
xvfb-run wine /tmp/python.exe \
|
||||
wine /tmp/python.exe \
|
||||
/quiet \
|
||||
InstallAllUsers=1 \
|
||||
PrependPath=1 \
|
||||
Include_test=0
|
||||
rm /tmp/python.exe
|
||||
|
||||
- name: Install Python dependencies (headless)
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
cd server
|
||||
xvfb-run wine "$WINEPYTHON" -m pip install --upgrade pip
|
||||
xvfb-run wine "$WINEPYTHON" -m pip install -r requirements.txt
|
||||
wine "$WINEPYTHON" -m pip install --upgrade pip
|
||||
wine "$WINEPYTHON" -m pip install -r requirements.txt
|
||||
|
||||
- name: Run tests (headless)
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd server
|
||||
xvfb-run wine "$WINEPYTHON" -m pip install pytest pytest-asyncio
|
||||
xvfb-run wine "$WINEPYTHON" -m pytest tests/ -v
|
||||
wine "$WINEPYTHON" -m pip install pytest pytest-asyncio
|
||||
wine "$WINEPYTHON" -m pytest tests/ -v
|
||||
|
||||
- name: Build .exe with PyInstaller (headless)
|
||||
- name: Build .exe with PyInstaller
|
||||
run: |
|
||||
cd server
|
||||
xvfb-run wine "$WINEPYTHON" -m PyInstaller \
|
||||
wine "$WINEPYTHON" -m PyInstaller \
|
||||
tray_wrapper.py \
|
||||
--name PaperDash \
|
||||
--onefile \
|
||||
@@ -81,6 +90,10 @@ jobs:
|
||||
--clean
|
||||
ls -la dist/
|
||||
|
||||
- name: Stop Xvfb
|
||||
if: always()
|
||||
run: killall Xvfb || true
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user