Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .github/workflows/build-linux-installer-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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" ]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux-installer-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
21 changes: 20 additions & 1 deletion chia/cmds/dev/installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import json
import subprocess
import sys
import tempfile
from collections.abc import Sequence
from typing import Optional

import click
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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")
Loading