CI - update to v4 of GitHub actions #1449
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [dev, stable] | |
pull_request: | |
branches: [dev, stable] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "${{matrix.title}} (${{matrix.cc}}, ${{matrix.arch}}, ${{matrix.build_type}})" | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { title: "Linux", os: "ubuntu-latest", cc: "clang", arch: "x64", build_type: "Release" } | |
- { title: "Linux", os: "ubuntu-latest", cc: "clang", arch: "x64", build_type: "Debug" } | |
- { title: "Linux", os: "ubuntu-latest", cc: "gcc", arch: "x64", build_type: "Release" } | |
- { title: "Linux", os: "ubuntu-latest", cc: "gcc", arch: "x64", build_type: "Debug" } | |
- { title: "Windows", os: "windows-latest", cc: "vs2022", arch: "x64", build_type: "Release" } | |
- { title: "Windows", os: "windows-latest", cc: "vs2022", arch: "x64", build_type: "Debug" } | |
- { title: "Mac", os: "macos-latest", cc: "clang", arch: "x64", build_type: "Release" } | |
- { title: "Mac", os: "macos-latest", cc: "clang", arch: "x64", build_type: "Debug" } | |
- { title: "Mac", os: "macos-latest", cc: "clang", arch: "arm64", build_type: "Release" } | |
- { title: "Mac", os: "macos-latest", cc: "clang", arch: "arm64", build_type: "Debug" } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v4 | |
id: ruby-inst | |
with: | |
ruby-version: 3.2 | |
if: matrix.os == 'windows-latest' | |
- name: Setup Ruby Windows | |
working-directory: ${{github.workspace}}/app | |
run: | | |
gem install rugged | |
gem install test-unit | |
if: matrix.os == 'windows-latest' | |
- name: Setup Ruby Gems | |
working-directory: ${{github.workspace}}/app | |
run: | | |
sudo gem install rugged | |
sudo gem install test-unit | |
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
- name: Add SymLink for Windows | |
working-directory: ${{github.workspace}}/app/server/native | |
run: | | |
ln -s ${{steps.ruby-inst.outputs.ruby-prefix}} ruby | |
if: matrix.os == 'windows-latest' | |
- name: Install Qt 6 | |
uses: jurplel/install-qt-action@v4 | |
with: | |
modules: "qtpositioning qtwebchannel qtwebengine qtwebsockets" | |
version: "6.7.0" | |
- name: Linux Elixir | |
uses: erlef/setup-beam@v4 | |
with: | |
otp-version: "26.1.2" | |
elixir-version: "1.15.7" | |
if: matrix.os == 'ubuntu-latest' | |
- name: Win Elixir | |
uses: erlef/setup-beam@v4 | |
with: | |
otp-version: "26.1.2" | |
elixir-version: "1.15.7" | |
if: matrix.os == 'windows-latest' | |
- name: Mac Elixir | |
continue-on-error: true | |
run: | | |
export HOMEBREW_NO_INSTALL_CLEANUP=1 | |
brew update | |
brew install elixir | |
if: matrix.os == 'macos-latest' | |
- name: Prebuild Linux | |
working-directory: ${{github.workspace}}/app | |
env: | |
CC: ${{ matrix.cc }} | |
QT_INSTALL_LOCATION: ${{env.Qt6_DIR}} | |
run: | | |
sudo apt install -y pulseaudio dbus-x11 libssl-dev ruby-dev supercollider-server sc3-plugins-server alsa-base alsa-utils jackd2 libjack-jackd2-dev libjack-jackd2-0 libasound2-dev librtmidi-dev pulseaudio-module-jack | |
./linux-prebuild.sh | |
if: matrix.os == 'ubuntu-latest' | |
- name: Prebuild Mac | |
working-directory: ${{github.workspace}}/app | |
env: | |
CC: ${{ matrix.cc }} | |
QT_INSTALL_LOCATION: ${{env.Qt6_DIR}} | |
run: ./mac-prebuild.sh | |
if: matrix.os == 'macos-latest' | |
- name: Prebuild Windows | |
working-directory: ${{github.workspace}}/app | |
shell: cmd | |
env: | |
CC: ${{ matrix.cc }} | |
QT_INSTALL_LOCATION: ${{env.Qt6_DIR}} | |
run: | | |
mv c:/msys64 c:/__msys64 | |
win-prebuild.bat | |
if: matrix.os == 'windows-latest' | |
- name: Config Linux | |
working-directory: ${{github.workspace}}/app | |
env: | |
CC: ${{ matrix.cc }} | |
QT_INSTALL_LOCATION: ${{env.Qt6_DIR}} | |
run: ./linux-config.sh --config ${{ matrix.build_type }} | |
if: matrix.os == 'ubuntu-latest' | |
- name: Config Mac | |
working-directory: ${{github.workspace}}/app | |
env: | |
CC: ${{ matrix.cc }} | |
QT_INSTALL_LOCATION: ${{env.Qt6_DIR}} | |
run: ./mac-config.sh --config ${{ matrix.build_type }} | |
if: matrix.os == 'macos-latest' | |
- name: Config Windows | |
working-directory: ${{github.workspace}}/app | |
shell: cmd | |
env: | |
CC: ${{ matrix.cc }} | |
QT_INSTALL_LOCATION: ${{env.Qt6_DIR}} | |
run: win-config.bat ${{ matrix.build_type }} | |
if: matrix.os == 'windows-latest' | |
- name: Build Linux | |
working-directory: ${{github.workspace}}/app | |
run: ./linux-build-gui.sh | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build Mac | |
working-directory: ${{github.workspace}}/app | |
run: ./mac-build-gui.sh | |
if: matrix.os == 'macos-latest' | |
- name: Build Windows | |
working-directory: ${{github.workspace}}/app | |
shell: cmd | |
run: win-build-gui.bat ${{ matrix.build_type }} | |
if: matrix.os == 'windows-latest' | |
- name: Build Tau Server (Linux) | |
working-directory: ${{github.workspace}}/app | |
run: ./linux-post-tau-prod-release.sh | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build Tau Server (Mac) | |
working-directory: ${{github.workspace}}/app | |
run: ./mac-post-tau-prod-release.sh | |
if: matrix.os == 'macos-latest' | |
- name: Build Tau Server (Windows) | |
working-directory: ${{github.workspace}}/app | |
shell: cmd | |
run: win-post-tau-prod-release.bat | |
if: matrix.os == 'windows-latest' | |
- name: BEAM Tests Windows | |
shell: cmd | |
working-directory: ${{github.workspace}}/app/server/beam/tau | |
run: mix test | |
env: | |
TAU_ENV: test | |
TAU_LOG_PATH: ${{github.workspace}}/tau_log.txt | |
if: matrix.os == 'windows-latest' | |
- name: BEAM Tests (Linux) | |
working-directory: ${{github.workspace}}/app/server/beam/tau | |
run: mix test | |
env: | |
TAU_ENV: test | |
TAU_LOG_PATH: ${{github.workspace}}/tau_log.txt | |
if: matrix.os == 'ubuntu-latest' | |
- name: BEAM Tests (macOS) | |
working-directory: ${{github.workspace}}/app/server/beam/tau | |
run: mix test | |
env: | |
TAU_ENV: test | |
TAU_LOG_PATH: ${{github.workspace}}/tau_log.txt | |
if: matrix.os == 'macos-latest' | |
- name: Ruby Tests (Mac/Linux) | |
working-directory: ${{github.workspace}}/app/server/ruby | |
run: rake test | |
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
- name: API Tests - Mac | |
working-directory: ${{github.workspace}}/app/build/api-tests | |
env: | |
SONIC_PI_ENV: test | |
run: ctest --verbose | |
if: matrix.os == 'macos-latest' | |
- name: API Tests - Linux | |
working-directory: ${{github.workspace}}/app/build/api-tests | |
env: | |
SONIC_PI_ENV: test | |
run: | | |
jackd -rd dummy & | |
ctest --verbose | |
if: matrix.os == 'ubuntu-latest' | |
- name: API Tests Windows - Install Scream Audio Device | |
shell: powershell | |
run: | | |
Start-Service audio* | |
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip | |
Expand-7ZipArchive -Path C:\Scream3.6.zip -DestinationPath C:\Scream | |
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate | |
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine") | |
$store.Open("ReadWrite") | |
$store.Add($cert) | |
$store.Close() | |
cd C:\Scream\Install\driver | |
C:\Scream\Install\helpers\devcon install Scream.inf *Scream | |
if: matrix.os == 'windows-latest' | |
- name: API Tests - Windows | |
shell: cmd | |
working-directory: ${{github.workspace}}/app/build/api-tests | |
env: | |
SONIC_PI_ENV: test | |
run: ctest --verbose | |
if: matrix.os == 'windows-latest' | |
- name: Archive Logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: Logs_${{matrix.title}}_${{matrix.cc}}_${{matrix.arch}}_${{matrix.build_type}} | |
path: | | |
~/.sonic-pi/log/*.log |