Skip to content

Test Installer

Test Installer #71

name: Test Installer
on:
workflow_dispatch:
workflow_run:
workflows: [Build VisualNeuro]
types:
- completed
jobs:
test-installer:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
os: [windows, macos, linux]
include:
- system: windows
os: 'windows-latest'
installer: 'visualneuro-installer-win'
- system: macos
os: 'macos-13' # for now macos-latest == macos-12 since macos-13 is still "beta"
installer: 'visualneuro-installer-macos'
#- system: linux
# os: 'ubuntu-22.04'
# installer: 'visualneuro-installer-ubuntu'
runs-on: ${{ matrix.os }}
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
name: ${{ matrix.installer }}
workflow: visualneuro.yml
###############################################################################
# Windows
###############################################################################
- name: Run Windows Installer
if: runner.os == 'Windows'
shell: pwsh
run: |
# find the name of the installer
$exe = Get-ChildItem -Name "Visual*.exe"
# launch the nsis installer in "silent mode" (/S), should run without user interaction
Invoke-expression "./'$exe' /S"
# this will spawn the installer in the background so we need to wait for it to finish
$proc = Get-Process | where {$_.ProcessName -like "VisualNeuro*"} | Select-Object -First 1
if ($proc) {
Wait-Process -Id $proc.id
}
- name: Run Visual Neuro
if: runner.os == 'Windows'
shell: pwsh
run: |
$ver = (Get-ChildItem -Name C:/"Program Files/VisualNeuroApp"/*)
Invoke-expression "C:/'Program Files/VisualNeuroApp/$ver/bin/VisualNeuro.exe' --logconsole --quit"
###############################################################################
# Macos
###############################################################################
- name: Run MacOS Installer
if: runner.os == 'macOS'
shell: bash
run: |
# Find the name of the installer
DMG=$(ls Visual*.dmg)
# Mount installer image
hdiutil attach "$DMG"
# Install by copying Visual Neuro.app to applications folder
cp -r "/Volumes/${DMG%%.dmg}/VisualNeuroApp.app" /Applications/
hdiutil detach "/Volumes/${DMG%%.dmg}/"
- name: Run Visual Neuro
if: runner.os == 'macOS'
shell: bash
run: |
cd "/Applications/VisualNeuroApp.app/Contents/MacOS/"
./"VisualNeuro" --logconsole --quit
###############################################################################
# Linux
###############################################################################
- name: Extract Linux installer and run Visual Neuro
if: runner.os == 'Linux'
shell: bash
run: |
# Find the name of the installer
TGZ=$(ls Visual*.tar.gz)
# Extract
tar zxvf "$TGZ"
# Get folder name and move into the folder
cd "${TGZ%.tar.gz}"
./"bin/VisualNeuro" --logconsole --quit