mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Add blackhole audiodevice for macOS Big sur, add sox and Switchaudio-osx versions to the docs (#3542)
This commit is contained in:
@@ -49,3 +49,14 @@ function Get-PathWithLink {
|
||||
$link = Get-LinkTarget($inputPath)
|
||||
return "${inputPath}${link}"
|
||||
}
|
||||
|
||||
function Get-BrewPackageVersion {
|
||||
param (
|
||||
[string] $CommandName
|
||||
)
|
||||
|
||||
(Get-LinkTarget (Get-Command $CommandName).Source | Out-String) -match "(?<version>(\d+.){2}\d+)" | Out-Null
|
||||
$packageVersion = $Matches.Version
|
||||
|
||||
return $packageVersion
|
||||
}
|
||||
@@ -1,17 +1,28 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
source ~/utils/utils.sh
|
||||
|
||||
echo "install soundflower"
|
||||
brew install --cask soundflower
|
||||
|
||||
echo "install switchaudio-osx"
|
||||
brew_smart_install "switchaudio-osx"
|
||||
|
||||
echo "install sox"
|
||||
brew_smart_install "sox"
|
||||
|
||||
echo "set Soundflower (2ch) as input/output device"
|
||||
SwitchAudioSource -s "Soundflower (2ch)" -t input
|
||||
SwitchAudioSource -s "Soundflower (2ch)" -t output
|
||||
# Big Sur doesn't support soundflower installation without user interaction https://github.com/mattingalls/Soundflower/releases/tag/2.0b2
|
||||
# Install blackhole-2ch for Big Sur instead
|
||||
if is_Less_BigSur; then
|
||||
echo "install soundflower"
|
||||
brew install --cask soundflower
|
||||
|
||||
echo "set Soundflower (2ch) as input/output device"
|
||||
SwitchAudioSource -s "Soundflower (2ch)" -t input
|
||||
SwitchAudioSource -s "Soundflower (2ch)" -t output
|
||||
else
|
||||
echo "install blackhole-2ch"
|
||||
brew_smart_install "blackhole-2ch"
|
||||
|
||||
echo "set BlackHole 2ch as input/output device"
|
||||
SwitchAudioSource -s "BlackHole 2ch" -t input
|
||||
SwitchAudioSource -s "BlackHole 2ch" -t output
|
||||
fi
|
||||
|
||||
invoke_tests "System" "Audio Device"
|
||||
|
||||
@@ -462,6 +462,16 @@ function Get-CabalVersion {
|
||||
return "Cabal $cabalVersion"
|
||||
}
|
||||
|
||||
function Get-SwitchAudioOsxVersion {
|
||||
$switchAudioVersion = Get-BrewPackageVersion -CommandName "SwitchAudioSource"
|
||||
return "Switchaudio-osx $switchAudioVersion"
|
||||
}
|
||||
|
||||
function Get-SoxVersion {
|
||||
$soxVersion = Get-BrewPackageVersion -CommandName "sox"
|
||||
return "Sox $soxVersion"
|
||||
}
|
||||
|
||||
function Get-StackVersion {
|
||||
$stackVersion = Run-Command "stack --version" | Take-Part -Part 1 | ForEach-Object {$_.replace(",","")}
|
||||
return "Stack $stackVersion"
|
||||
|
||||
@@ -145,6 +145,13 @@ if ($os.IsLessThanBigSur) {
|
||||
)
|
||||
}
|
||||
|
||||
if (-not $os.IsHighSierra) {
|
||||
$utilitiesList += @(
|
||||
(Get-SwitchAudioOsxVersion),
|
||||
(Get-SoxVersion)
|
||||
)
|
||||
}
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines ($utilitiesList | Sort-Object)
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@
|
||||
"./provision/core/nginx.sh",
|
||||
"./provision/core/postgresql.sh",
|
||||
"./provision/core/mongodb.sh",
|
||||
"./provision/core/audiodevice.sh",
|
||||
"./provision/core/vcpkg.sh",
|
||||
"./provision/core/miniconda.sh",
|
||||
"./provision/core/chrome.sh",
|
||||
|
||||
@@ -17,7 +17,7 @@ Describe "Certificate" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Audio device" -Skip:($os.IsHighSierra -or $os.IsBigSur) {
|
||||
Describe "Audio device" -Skip:($os.IsHighSierra) {
|
||||
It "Sox is installed" {
|
||||
"sox --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
@@ -26,9 +26,13 @@ Describe "Audio device" -Skip:($os.IsHighSierra -or $os.IsBigSur) {
|
||||
"SwitchAudioSource -c" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Audio channel Soundflower (2ch)" {
|
||||
It "Audio channel Soundflower (2ch)" -Skip:($os.IsBigSur) {
|
||||
SwitchAudioSource -c | Should -BeLikeExactly "Soundflower (2ch)"
|
||||
}
|
||||
|
||||
It "Audio channel BlackHole 2ch" -Skip:($os.IsLessThanBigSur) {
|
||||
SwitchAudioSource -c | Should -BeLikeExactly "BlackHole 2ch"
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Screen Resolution" -Skip:($os.IsHighSierra) {
|
||||
|
||||
Reference in New Issue
Block a user