|
54 | 54 | path: dist_appimage/*.AppImage* |
55 | 55 | if-no-files-found: error |
56 | 56 | retention-days: 14 |
| 57 | + |
| 58 | + smokeTest: |
| 59 | + name: Smoke Test AppImage (${{ matrix.distro }}) |
| 60 | + needs: buildLinux-AppImage |
| 61 | + runs-on: ubuntu-22.04 |
| 62 | + permissions: |
| 63 | + contents: read |
| 64 | + strategy: |
| 65 | + fail-fast: false |
| 66 | + matrix: |
| 67 | + include: |
| 68 | + - distro: Ubuntu 22.04 |
| 69 | + image: ubuntu:22.04 |
| 70 | + - distro: Debian 12 |
| 71 | + image: debian:12 |
| 72 | + - distro: Fedora 40 |
| 73 | + image: fedora:40 |
| 74 | + - distro: Arch Linux |
| 75 | + image: archlinux:latest |
| 76 | + - distro: Manjaro |
| 77 | + image: manjarolinux/base:latest |
| 78 | + container: |
| 79 | + image: ${{ matrix.image }} |
| 80 | + steps: |
| 81 | + - name: Install Runtime Dependencies |
| 82 | + run: | |
| 83 | + if command -v apt-get >/dev/null 2>&1; then |
| 84 | + apt-get update |
| 85 | + apt-get install -y ca-certificates libgl1 libxkbcommon0 libegl1 libfontconfig1 libglib2.0-0 libdbus-1-3 |
| 86 | + elif command -v dnf >/dev/null 2>&1; then |
| 87 | + dnf install -y ca-certificates coreutils mesa-libGL mesa-libEGL libxkbcommon fontconfig glib2 dbus-libs |
| 88 | + elif command -v pacman >/dev/null 2>&1; then |
| 89 | + pacman -Syu --noconfirm --needed ca-certificates coreutils mesa libxkbcommon fontconfig glib2 dbus |
| 90 | + fi |
| 91 | +
|
| 92 | + - name: Download AppImage Artifact |
| 93 | + uses: actions/download-artifact@v8 |
| 94 | + with: |
| 95 | + pattern: novelWriter-*-Linux-AppImage |
| 96 | + merge-multiple: true |
| 97 | + path: appimage-dist |
| 98 | + |
| 99 | + - name: Run AppImage Smoke Test |
| 100 | + run: | |
| 101 | + set -eu |
| 102 | + APPIMAGE_FILE="$(find appimage-dist -maxdepth 1 -name '*.AppImage' | head -n1)" |
| 103 | + if [ -z "$APPIMAGE_FILE" ]; then |
| 104 | + echo "No AppImage artifact found" |
| 105 | + exit 1 |
| 106 | + fi |
| 107 | +
|
| 108 | + chmod +x "$APPIMAGE_FILE" |
| 109 | + export QT_QPA_PLATFORM=offscreen |
| 110 | + export QT_NO_XDG_DESKTOP_PORTAL=1 |
| 111 | + export APPIMAGE_EXTRACT_AND_RUN=1 |
| 112 | +
|
| 113 | + set +e |
| 114 | + timeout 25s "$APPIMAGE_FILE" > smoke.log 2>&1 |
| 115 | + EXIT_CODE=$? |
| 116 | + set -e |
| 117 | +
|
| 118 | + if [ "$EXIT_CODE" -eq 139 ]; then |
| 119 | + echo "AppImage crashed with segmentation fault" |
| 120 | + exit 1 |
| 121 | + fi |
| 122 | +
|
| 123 | + if grep -Eiq 'segmentation fault|core dumped' smoke.log; then |
| 124 | + echo "Crash signature found in smoke log" |
| 125 | + exit 1 |
| 126 | + fi |
| 127 | +
|
| 128 | + if [ "$EXIT_CODE" -ne 0 ] && [ "$EXIT_CODE" -ne 124 ]; then |
| 129 | + echo "Unexpected exit code: $EXIT_CODE" |
| 130 | + cat smoke.log |
| 131 | + exit 1 |
| 132 | + fi |
| 133 | +
|
| 134 | + - name: Upload Smoke Logs |
| 135 | + if: always() |
| 136 | + uses: actions/upload-artifact@v7 |
| 137 | + with: |
| 138 | + name: appimage-smoke-log-${{ matrix.distro }} |
| 139 | + path: smoke.log |
| 140 | + if-no-files-found: ignore |
| 141 | + retention-days: 14 |
0 commit comments