Skip to content

Ecoacoustics Audio Analysis Software v23.9.0.2 #69

Ecoacoustics Audio Analysis Software v23.9.0.2

Ecoacoustics Audio Analysis Software v23.9.0.2 #69

Workflow file for this run

name: installer
on:
push:
branches:
- $default-branch
paths:
- build/*
- .github/*
pull_request:
paths:
- build/*
- .github/*
release:
defaults:
run:
shell: pwsh
env:
SCRIPT_URL: "https://raw.githubusercontent.com/QutEcoacoustics/audio-analysis/${{ github.sha }}/build/download_ap.ps1"
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test-script-host:
runs-on: ubuntu-latest
steps:
- name: ensure script host serves the script with "charset=utf-8"
run: |
curl -Ii "$env:SCRIPT_URL" | Write-Output -OutVariable "response"
$response | grep "charset=utf-8"
- name: ensure short url redirects to download script
# if this test ever fails, recreate short url and update the installing.md docs
run: |
curl -Ii "https://git.io/JtOo3" | Write-Output -OutVariable "response"
$response | grep "https://raw.githubusercontent.com/QutEcoacoustics/audio-analysis/.*/build/download_ap.ps1"
test-installer:
strategy:
fail-fast: false
matrix:
os:
# https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources
- windows-latest
- ubuntu-18.04
- ubuntu-20.04
# macos-11.0 is in private preview stage https://github.com/actions/virtual-environments/issues/2486
# - macos-11.0
- macos-10.15
include:
- os: windows-latest
alias_name: "AP.exe"
bin_dir: "~\\AP"
- os: ubuntu-18.04
alias_name: "AP"
bin_dir: "~/.local/bin"
- os: ubuntu-20.04
alias_name: "AP"
bin_dir: "~/.local/bin"
# - os: macos-11.0
# alias_name: "AP"
# bin_dir: "~/.local/bin"
- os: macos-10.15
alias_name: "AP"
bin_dir: "~/.local/bin"
# https://raw.githubusercontent.com/QutEcoacoustics/audio-analysis/5f08faa96d8f044fb278b68f1c7d577fe218e8a1/build/download_ap.ps1
runs-on: ${{ matrix.os }}
name: Test installer (${{ matrix.os }})
# This workflow tests if our "installer"
# script works.
# It needs to test:
# - remote download
# - install
# - adding to PATH
# - uninstall
# Need to use -Force on commands because CI is not interactive
# https://github.com/PowerShell/PowerShell/issues/3337
steps:
- name: Get info about action runner
run: $PSVersionTable
# must use -Force on CI to suppress interactive steps
# otherwise interactive steps will crash (e.g. when warning on install overwrite)
- name: Test installer (remote download)
uses: knicknic/[email protected]
with:
macos: >
pwsh -nop -c '$function:i=irm "$env:SCRIPT_URL";i -Force'
linux: >
pwsh -nop -c '$function:i=irm "$env:SCRIPT_URL";i -Force'
windows: >
pwsh -nop -ex B -c '$function:i=irm "$env:SCRIPT_URL";i -Force'
- name: Test installer (upgrade)
uses: knicknic/[email protected]
with:
macos: >
pwsh -nop -c '$function:i=irm "$env:SCRIPT_URL";i -Force -Prerelease'
linux: >
pwsh -nop -c '$function:i=irm "$env:SCRIPT_URL";i -Force -Prerelease'
windows: >
pwsh -nop -ex B -c '$function:i=irm "$env:SCRIPT_URL";i -Force -Prerelease'
- name: Update PATH
# Github actions doesn't persist changes to PATH during steps
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
run: >
echo "$env:AP_PATH" | Resolve-Path | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
env:
AP_PATH: ${{ matrix.bin_dir }}
- name: Check alias works
run: |
Get-ChildItem "$env:AP_PATH/$env:ALIAS_NAME"
AP --version
env:
AP_PATH: ${{ matrix.bin_dir }}
ALIAS_NAME: ${{ matrix.alias_name }}
- name: Test installer (uninstall)
uses: knicknic/[email protected]
with:
macos: >
pwsh -nop -c '$function:i=irm "$env:SCRIPT_URL";i -Force -Uninstall'
linux: >
pwsh -nop -c '$function:i=irm "$env:SCRIPT_URL";i -Force -Uninstall'
windows: >
pwsh -nop -ex B -c '$function:i=irm "$env:SCRIPT_URL";i -Force -Uninstall'
- name: Check alias no longer works
run: |
Get-Command AP -ErrorAction 'Continue'
if ($error[0] -match "The term 'AP' is not recognized") {
exit 0
}
exit 1