Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request Workflow in place, for testing #7733

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Build Pull Request
on:
pull_request:

defaults:
run:
shell: bash

jobs:
build_plugin:
name: PR - ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: "windows msvc"
os: windows-latest
target: surge-xt_Standalone
cmakeConfig: -A x64
cmakeOpt: DEBUG
runTests: false
- name: "windows msvc 32 bit"
os: windows-latest
target: surge-xt_Standalone
cmakeConfig: -A Win32
cmakeOpt: DEBUG
runTests: false
- name: "windows clang"
os: windows-latest
target: surge-xt_Standalone
cmakeConfig: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
cmakeOpt: DEBUG
runTests: false
- name: "ubuntu standalone"
os: ubuntu-latest
target: surge-xt_Standalone
cmakeConfig:
cmakeOpt: DEBUG
runTests: false
- name: "macos standalone"
os: macos-latest
target: surge-xt_Standalone
cmakeConfig: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmakeOpt: DEBUG
runTests: false

- name: "mac test runner"
os: macos-latest
target: surge-testrunner
cmakeConfig:
cmakeOpt: RELEASE
runTests: true
- name: "linux test runner"
os: ubuntu-latest
target: surge-testrunner
cmakeConfig:
cmakeOpt: RELEASE
runTests: true
- name: "windows test runner"
os: windows-latest
target: surge-testrunner
cmakeConfig: -A x64
cmakeOpt: RELEASE
runTests: true

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Prepare for JUCE
uses: surge-synthesizer/sst-githubactions/prepare-for-juce@main
with:
os: ${{ runner.os }}

- name: Build pull request version
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=${{ matrix.cmakeOpt }} ${{ matrix.cmakeConfig }}
cmake --build ./build --config ${{ matrix.cmakeOpt }} --target ${{ matrix.target }} --parallel 3

- name: Run Tests
if: ${{ matrix.runTests }}
run: |
set -e

cd build
ctest -j 4 || ctest --rerun-failed --output-on-failure

build_plugin_lindoc:
name: PR - U18 Docker
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build in Docker
uses: surge-synthesizer/sst-githubactions/cmake-in-docker@main
with:
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
cmakeArgs: -DCMAKE_BUILD_TYPE=Debug -GNinja
target: surge-xt_Standalone

193 changes: 0 additions & 193 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,199 +29,6 @@ jobs:

displayName: Do Codequal

- job: BuildLinuxDocker
condition: eq(variables['Build.Reason'], 'PullRequest')
pool:
vmImage: 'ubuntu-20.04'

steps:
- checkout: self
fetchDepth: 1
# submodules: recursive # can't do submodules here b'cuz depth=1 fails with Github

- bash: |
set -x

export VUID=$(id -u)
export VGID=$(id -g)

docker pull baconpaul/sst-dockerimages-ubuntu18:3
docker create --user $VUID:$VGID --name surge-build-u18 --interactive --tty \
--volume=`pwd`:/home/build/surge baconpaul/sst-dockerimages-ubuntu18:3
docker start surge-build-u18

git submodule update --init --recursive
docker exec surge-build-u18 bash -c "(cd /home/build/surge && ./scripts/docker-build/build.sh build --target surge-xt_LV2 --parallel 6)"
docker stop surge-build-u18

ls build/surge_xt_products
displayName: Do Docker Build


- job: BuildForPR
condition: eq(variables['Build.Reason'], 'PullRequest')
variables:
defaultTargets: "surge-xt_Packaged surge-fx_Packaged"
strategy:
matrix:
macOS-unit-test:
imageName: 'macos-latest'
isMac: True
isMacUnitTest: True
isUnitTest: True
cmakeArguments: "-GNinja"
cmakeTarget: "surge-testrunner"
cmakeConfig: "Release"
windows-x86-32bit-msvc:
imageName: 'windows-2019'
isWindows: True
cmakeArguments: "-A Win32 -DCMAKE_BUILD_TYPE=Debug"
cmakeConfig: "Debug"
cmakeTarget: "surge-xt_CLAP" # just a subset for time
macOS-x86:
imageName: 'macos-latest'
isMac: True
isMacFat: True
cmakeArguments: "-GNinja -DCMAKE_BUILD_TYPE=Debug -D\"CMAKE_OSX_ARCHITECTURES=x86_64\""
cmakeTarget: $(defaultTargets)
cmakeConfig: "Debug"
macOS-arm:
imageName: 'macos-latest'
isMac: True
isMacFat: True
cmakeArguments: "-GNinja -DCMAKE_BUILD_TYPE=Debug -D\"CMAKE_OSX_ARCHITECTURES=arm64\""
cmakeTarget: $(defaultTargets)
cmakeConfig: "Debug"
windows-x64-msvc:
imageName: 'windows-2019'
isWindows: True
cmakeArguments: "-A x64 -DCMAKE_BUILD_TYPE=Debug"
cmakeConfig: "Debug"
cmakeTarget: $(defaultTargets)
#windows-x64-clang:
# imageName: 'windows-2022'
# isWindows: True
# cmakeArguments: "-GNinja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Debug"
# cmakeConfig: "Debug"
# cmakeTarget: $(defaultTargets)
windows-unittest-clang:
imageName: 'windows-2022'
isWindows: True
isWindowsUnitTest: True
isUnitTest: True
cmakeArguments: "-A x64 -DCMAKE_BUILD_TYPE=Release"
#cmakeArguments: "-GNinja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Release"
cmakeConfig: "Release"
cmakeTarget: "surge-testrunner"
linux-juce-python-targets:
imageName: 'ubuntu-22.04'
isLinux: True
cmakeArguments: "-GNinja -DCMAKE_BUILD_TYPE=Debug -DSURGE_BUILD_PYTHON_BINDINGS=True"
cmakeTarget: "surge-xt_Packaged surge-fx_Packaged surgepy"
cmakeConfig: "Debug"
linux-unittest:
imageName: 'ubuntu-latest'
isLinux: True
isLinuxUnitTest: True
isUnitTest: True
cmakeArguments: "-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_COMPILER=gcc-12"
cmakeConfig: "Release"
cmakeTarget: "surge-testrunner"


pool:
vmImage: $(imageName)

steps:
- checkout: self
fetchDepth: 1
# submodules: recursive # can't do submodules here b'cuz depth=1 fails with Github

- bash: |
echo "BUILD REASON = " $BUILD_REASON
echo "cmakeArguments = " $(cmakeArguments)
echo "cmakeTarget = " $(cmakeTarget)
echo "cmakeConfig = " $(cmakeConfig)
echo "aptGetExtras = " $(aptGetExtras)
displayName: all - details on build

- bash: |
# do this here, because we're using a shallow clone and it fails using `submodules: recursive` above

# Pipelines be timin out. Try this thrice. Should be cheap if it works.
. ./scripts/misc/defensive-submodule.sh
. ./scripts/misc/defensive-submodule.sh
. ./scripts/misc/defensive-submodule.sh
displayName: all - submodule init


- bash: |
set -e

echo "aptGetExtras are $(aptGetExtras)"
sudo apt-get update

sudo apt-get install -y \
devscripts \
libxcb-cursor-dev \
libxcb-keysyms1-dev \
libxcb-util-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
ninja-build \
xcb \
$(aptGetExtras)

# These are the JUCE deps
sudo apt-get install -y libgtk-3-dev
sudo apt-get install -y libwebkit2gtk-4.0
sudo apt-get install -y libwebkit2gtk-4.0-dev
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y alsa
sudo apt-get install -y alsa-tools
sudo apt-get install -y libasound2-dev
sudo apt-get install -y libjack-dev
sudo apt-get install -y libfreetype6-dev
sudo apt-get install -y libxinerama-dev
sudo apt-get install -y libxcb-xinerama0
sudo apt-get install -y libxinerama1
sudo apt-get install -y x11proto-xinerama-dev
sudo apt-get install -y libxrandr-dev
sudo apt-get install -y libgl1-mesa-dev
sudo apt-get install -y libxcursor-dev
sudo apt-get install -y libxcursor1
sudo apt-get install -y libxcb-cursor-dev
sudo apt-get install -y libxcb-cursor0
sudo apt-get install -y --fix-missing

condition: variables.isLinux
displayName: linux - run apt-get

- bash: |
brew install ninja
sudo xcode-select -s /Applications/Xcode_13.4.1.app
displayName: Select XCode 13.4.1
condition: variables.isMac

- bash: |
set -e
cmake -Bbuild $(cmakeArguments)
displayName: all - configure with cmake

- bash: |
set -e
cmake --build build --config $(cmakeConfig) --target $(cmakeTarget) --parallel 8
displayName: all - build with cmake

- bash: |
set -e

cd build
ctest -j 4 || ctest --rerun-failed --output-on-failure

condition: variables.isUnitTest
displayName: all - run unit tests

- job: NotifyReleases
dependsOn: BuildCodeQuality
condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')))
Expand Down
Loading