Using Ninja with ClangCL for CI builds #1069
Workflow file for this run
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
repository_dispatch: | |
types: [add_ons_push] | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
name: Test plugin on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # show all errors for each platform (vs. cancel jobs on error) | |
matrix: | |
include: | |
- os: ubuntu-latest | |
cmake_args: "-DCMAKE_CXX_COMPILER=g++-11" | |
- os: windows-2022 | |
cmake_args: "-G\"Ninja Multi-Config\" -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl" | |
- os: macos-13 | |
cmake_args: "-DCMAKE_BUILD_TYPE=Release" | |
steps: | |
- name: Install Linux Deps | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt install libasound2-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libfreetype6-dev libglu1-mesa-dev libjack-jackd2-dev | |
- name: Set Xcode version | |
if: runner.os == 'MacOS' | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.2' | |
- name: Add msbuild to PATH | |
if: runner.os == 'Windows' | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup MSVC devcmd | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Get latest CMake | |
uses: lukka/get-cmake@latest | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Checkout add-ons | |
uses: actions/checkout@v2 | |
if: github.event_name != 'pull_request' | |
with: | |
ref: main | |
repository: Chowdhury-DSP/BYOD-add-ons | |
path: modules/BYOD-add-ons | |
token: ${{ secrets.OUR_GITHUB_PAT }} | |
- name: Checkout Jai | |
uses: actions/checkout@v2 | |
if: github.actor == 'jatinchowdhury18' | |
with: | |
ref: main | |
repository: Chowdhury-DSP/jai-minimal | |
token: ${{ secrets.OUR_GITHUB_PAT }} | |
path: modules/jai | |
- name: Configure | |
env: | |
CMAKE_ARGS: ${{ matrix.cmake_args }} | |
CONFIGURE_ADD_ONS_FLAG: "${{ github.event_name != 'pull_request' && '-DBYOD_BUILD_ADD_ON_MODULES=ON' || '' }}" | |
run: cmake -Bbuild $CONFIGURE_ADD_ONS_FLAG $CMAKE_ARGS | |
- name: Build | |
run: cmake --build build --config Release --parallel 4 --target BYOD_Standalone BYOD_VST3 BYOD_CLAP | |
- name: Unit Tests | |
if: runner.os == 'Linux' || runner.os == 'MacOS' | |
run: | | |
cmake --build build --config Release --parallel 4 --target BYOD_headless | |
build/BYOD --unit-tests --all | |
- name: Validate | |
if: runner.os == 'Windows' # || runner.os == 'MacOS' | |
run: bash scripts/validate.sh | |
# - name: Setup debug session | |
# if: always() | |
# uses: mxschmitt/action-tmate@v3 |