diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index adf9fe2..ccdb816 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -23,6 +23,9 @@ jobs: with: python-version: "3.8" + - name: Setup OpenGL + run: brew install mesa-glu libxrender libxi libxkbcommon + - name: Download ANTs uses: robinraju/release-downloader@main with: @@ -53,12 +56,18 @@ jobs: mkdir tmp_dependencies pyinstaller --log-level INFO --noconfirm --clean assets/main.spec -# - name: Test executable -# run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ -# shell: bash -# -# - name: Test GUI startup -# run: cd ${{github.workspace}}/tests && python software_launch_test.py + - name: Test executable + env: + DISPLAY: ':1' + run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ + shell: bash + + - name: Test GUI startup + env: + DISPLAY: ':1' + run: | + export QT_QPA_PLATFORM="offscreen" + cd ${{github.workspace}}/tests && python software_launch_test.py - name: Make installer run: | diff --git a/.github/workflows/build_macos_arm.yml b/.github/workflows/build_macos_arm.yml index dc43d3a..d804a52 100644 --- a/.github/workflows/build_macos_arm.yml +++ b/.github/workflows/build_macos_arm.yml @@ -34,27 +34,6 @@ jobs: pip install urllib3==1.26.6 deactivate -# - name: Install cmake -# run: | -# brew update -# brew install cmake ninja -# ninja --version -# cmake --version -# -# - name: Build ANTs -# run: | -# cd ${{github.workspace}} -# mkdir ANTs -# cd ANTs -# git clone https://github.com/ANTsX/ANTs.git source -# mkdir build -# cd build -# cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ANTs/install ../source -# make -j4 -# cd ANTS-build -# make install -# cp -R ${{github.workspace}}/ANTs/source/Scripts ${{github.workspace}}/ANTs/install/ - - name: Download ANTs uses: robinraju/release-downloader@main with: @@ -79,17 +58,17 @@ jobs: pyinstaller --log-level INFO --noconfirm --clean assets/main_arm.spec - name: Test executable - run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ + run: ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ shell: bash - name: Test GUI startup - run: cd ${{github.workspace}}/tests && python software_launch_test.py + run: cd ${{github.workspace}}/tests && python3 software_launch_test.py - name: Make installer run: | git clone https://github.com/dbouget/quickpkg.git - quickpkg/quickpkg dist/Raidionics.app --output Raidionics-1.2.1-macOS.pkg - cp -r Raidionics-1.2.1-macOS.pkg dist/Raidionics-1.2.1-macOS-arm64.pkg + quickpkg/quickpkg dist/Raidionics.app --output Raidionics-1.2.2-macOS.pkg + cp -r Raidionics-1.2.2-macOS.pkg dist/Raidionics-1.2.2-macOS-arm64.pkg - name: Upload package uses: actions/upload-artifact@v3 diff --git a/.github/workflows/build_ubuntu.yml b/.github/workflows/build_ubuntu.yml index f6e8a07..efdc1ca 100644 --- a/.github/workflows/build_ubuntu.yml +++ b/.github/workflows/build_ubuntu.yml @@ -20,6 +20,19 @@ jobs: with: python-version: "3.8" + - name: Free Up GitHub Actions Ubuntu Runner Disk Space + uses: dbouget/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + + # All of these default to true, but feel free to set to "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + - name: Install CL dependencies run: | apt update && apt install -y sudo @@ -32,23 +45,13 @@ jobs: sudo apt-get install -y pocl-opencl-icd - name: Setup OpenGL - run: sudo apt-get install -y libopengl0 + run: sudo apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev - name: Debug clinfo run: clinfo - - name: Free Up GitHub Actions Ubuntu Runner Disk Space - uses: dbouget/free-disk-space@main - with: - # This might remove tools that are actually needed, if set to "true" but frees about 6 GB - tool-cache: false - - # All of these default to true, but feel free to set to "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - swap-storage: true + - name: Setup X virtual framebuffer + run: sudo apt-get install -y xvfb - name: Download ANTs uses: robinraju/release-downloader@main @@ -80,12 +83,24 @@ jobs: mkdir tmp_dependencies pyinstaller --log-level INFO --noconfirm --clean assets/main.spec -# - name: Test executable -# run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ -# shell: bash -# -# - name: Test GUI startup -# run: cd ${{github.workspace}}/tests && python software_launch_test.py + - name: Test executable xvfb + env: + DISPLAY: ':1' + run: xvfb-run ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ + shell: bash + + - name: Test executable + env: + DISPLAY: ':1' + run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ + shell: bash + + - name: Test GUI startup + env: + DISPLAY: ':1' + run: | + export QT_QPA_PLATFORM="offscreen" + cd ${{github.workspace}}/tests && python software_launch_test.py - name: Make installer run: | diff --git a/tests/software_launch_test.py b/tests/software_launch_test.py index 35d0a01..224f66f 100644 --- a/tests/software_launch_test.py +++ b/tests/software_launch_test.py @@ -33,8 +33,9 @@ def software_launch_test(): proc.send_signal(signal.CTRL_BREAK_EVENT) proc.kill() else: - proc = subprocess.Popen([os.path.join(build_executable_path, 'Raidionics')], stdout=subprocess.PIPE, - stderr=subprocess.PIPE, preexec_fn=os.setsid) + os.environ['QT_QPA_PLATFORM'] = "offscreen" + proc = subprocess.Popen([os.path.join(build_executable_path, 'Raidionics')], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=os.setsid) time.sleep(10) stdout = proc.stdout stderr = proc.stderr