diff --git a/.github/workflows/build-linux-installer-deb.yml b/.github/workflows/build-linux-installer-deb.yml index 6b06f88005fc..d4ef8d61ad45 100644 --- a/.github/workflows/build-linux-installer-deb.yml +++ b/.github/workflows/build-linux-installer-deb.yml @@ -261,19 +261,27 @@ jobs: type: debian # https://packages.debian.org/bookworm/python/python3 (3.11) url: "docker://debian:bookworm" + skip: gui - name: ubuntu:jammy (22.04) type: ubuntu # https://packages.ubuntu.com/jammy/python3 (22.04, 3.10) url: "docker://ubuntu:jammy" + skip: gui - name: ubuntu:noble (24.04) type: ubuntu # https://packages.ubuntu.com/noble/python3 (24.04, 3.12) url: "docker://ubuntu:noble" + skip: gui + - name: webtop:ubuntu-kde + type: ubuntu + url: lscr.io/linuxserver/webtop:ubuntu-kde mode: - name: GUI + matrix: gui file: chia-blockchain_*.deb package: chia-blockchain - name: CLI + matrix: cli file: chia-blockchain-cli_*.deb package: chia-blockchain-cli arch: @@ -283,6 +291,15 @@ jobs: - name: Intel matrix: intel artifact-name: intel + exclude: + - mode: + matrix: gui + distribution: + skip: gui + - mode: + matrix: cli + distribution: + skip: cli env: DEBIAN_FRONTEND: noninteractive @@ -312,7 +329,12 @@ jobs: - name: Run chia dev installers test run: | - chia dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" + USERNAME=testuser + USER_UID=2001 + USER_GID=${USER_UID} + groupadd --gid $USER_GID $USERNAME + useradd --uid $USER_UID --gid $USER_GID -m $USERNAME + su $USERNAME -c 'chia dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" ${{ matrix.mode.matrix == 'gui' && '--gui-command chia-blockchain' || '' }}' - name: Verify /opt/chia present run: | @@ -324,7 +346,7 @@ jobs: - name: Check permissions of /opt/chia/chrome-sandbox shell: bash - if: matrix.mode.name == 'GUI' + if: matrix.mode.matrix == 'gui' run: | [ "$(stat -c %a:%G:%U /opt/chia/chrome-sandbox)" == "4755:root:root" ] diff --git a/.github/workflows/build-linux-installer-rpm.yml b/.github/workflows/build-linux-installer-rpm.yml index 78074041381d..e41285425906 100644 --- a/.github/workflows/build-linux-installer-rpm.yml +++ b/.github/workflows/build-linux-installer-rpm.yml @@ -327,7 +327,7 @@ jobs: - name: Run chia dev installers test run: | - chia dev installers test --require-no-madmax --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" + chia dev installers test --require-no-madmax --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" ${{ matrix.mode.matrix == 'gui' && '--gui-command chia-blockchain' || '' }} - name: Verify /opt/chia present run: | diff --git a/.github/workflows/build-macos-installers.yml b/.github/workflows/build-macos-installers.yml index 5515c74de233..9501abdb4daf 100644 --- a/.github/workflows/build-macos-installers.yml +++ b/.github/workflows/build-macos-installers.yml @@ -348,7 +348,7 @@ jobs: run: | # TODO: maybe fix this and remove the disable # shellcheck disable=SC2211 - "/Volumes/Chia "*"/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia" dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" + "/Volumes/Chia "*"/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia" dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" --gui-command open --gui-command "/Volumes/Chia "*/Chia.app - name: Detach .dmg if: always() diff --git a/.github/workflows/build-windows-installer.yml b/.github/workflows/build-windows-installer.yml index 85162ee43c1f..f30997f507fb 100644 --- a/.github/workflows/build-windows-installer.yml +++ b/.github/workflows/build-windows-installer.yml @@ -367,4 +367,4 @@ jobs: - name: Run chia dev installers test shell: pwsh run: | - & ($env:INSTALL_PATH + "/resources/app.asar.unpacked/daemon/chia.exe") dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" + & ($env:INSTALL_PATH + "/resources/app.asar.unpacked/daemon/chia.exe") dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}" --gui-command ($env:INSTALL_PATH + "/Chia.exe") diff --git a/chia/cmds/dev/installers.py b/chia/cmds/dev/installers.py index 653dab07183e..a4dbb254f850 100644 --- a/chia/cmds/dev/installers.py +++ b/chia/cmds/dev/installers.py @@ -2,7 +2,9 @@ import json import subprocess +import sys import tempfile +from collections.abc import Sequence from typing import Optional import click @@ -50,7 +52,8 @@ def installers_group() -> None: @installers_group.command(name="test") @click.option("--expected-chia-version", "expected_chia_version_str", required=True) @click.option("--require-madmax/--require-no-madmax", "require_madmax", default=True) -def test_command(expected_chia_version_str: str, require_madmax: bool) -> None: +@click.option("--gui-command", multiple=True) +def test_command(expected_chia_version_str: str, require_madmax: bool, gui_command: Sequence[str]) -> None: print("testing installed executables") expected_chia_version = packaging.version.Version(expected_chia_version_str) @@ -129,3 +132,19 @@ def test_command(expected_chia_version_str: str, require_madmax: bool) -> None: check=True, timeout=adjusted_timeout(30), ) + + if len(gui_command) == 0: + print("skipping gui launch test") + else: + print(f"launching: {gui_command}") + sys.stdout.flush() + try: + subprocess.run( + args=gui_command, + check=True, + timeout=adjusted_timeout(30), + ) + except subprocess.TimeoutExpired: + pass + else: + raise Exception("process terminated prior to timeout")