Skip to content

CI

CI #217

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
schedule:
- cron: '10 5 * * *' # run once a day
pull_request:
branches:
- main
- next
env:
SCCACHE_GHA_ENABLED: "true"
concurrency:
group: ${{ github.workflow }}.${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
BuildAndTest:
name: ${{ matrix.os }} ${{ matrix.app }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
app: [ member_enabled, member_disabled, unique_ptr_enabled, unique_ptr_disabled ]
os: [ macos-14, windows-2022, ubuntu-latest ]
juce: [ JUCE7, JUCE8 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Use dev command prompt (Windows)
uses: ilammy/msvc-dev-cmd@v1
with:
sdk: 10.0.22621.0 # fixed to break random CI breakage
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Install macOS Deps
if: ${{ runner.os == 'macOS' }}
run: brew install ninja osxutils
- 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 ninja-build
# This block can be removed once 15.1 is default (JUCE requires it when building on macOS 14)
- name: Use latest Xcode on system (macOS)
if: ${{ matrix.os == 'macos-14' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.5
- name: Configure (Windows without Ninja)
if: runner.os == 'Windows'
run: |
if [ "${{ matrix.juce }}" == "JUCE7" ]; then
cmake -B Builds -DTARGET_NAME:STRING=${{ matrix.app }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache . -DJUCE7=ON
else
cmake -B Builds -DTARGET_NAME:STRING=${{ matrix.app }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache .
fi
- name: Configure (Non-Windows with Ninja)
if: runner.os != 'Windows'
run: |
if [ "${{ matrix.juce }}" == "JUCE7" ]; then
cmake -B Builds -G Ninja -DTARGET_NAME:STRING=${{ matrix.app }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache . -DJUCE7=ON
else
cmake -B Builds -G Ninja -DTARGET_NAME:STRING=${{ matrix.app }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache .
fi
- name: Build
run: cmake --build Builds --parallel 4
- name: Run
if: ${{ matrix.os == 'macos-latest' }}
working-directory: Builds/${{ matrix.app }}_artefacts
timeout-minutes: 2
run: |
ls -ahl
${{ matrix.app }}.app/Contents/MacOS/${{ matrix.app }} &
- name: Run
if: ${{ matrix.os == 'windows-latest' }}
working-directory: Builds/${{ matrix.app }}_artefacts
timeout-minutes: 2
run: |
ls -ahl
./Debug/${{ matrix.app }}.exe &
- uses: OrbitalOwen/desktop-screenshot-action@0.1
if: ${{ matrix.os == 'windows-latest' }}
with:
file-name: ${{ matrix.os }}-${{matrix.app}}.jpg