diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 579ce3dc4..891f13c8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,11 @@ name: Build on: [pull_request] jobs: build-mac: - name: Build Mac UI - runs-on: macos-latest + name: Mac UI on ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 @@ -11,15 +14,38 @@ jobs: working-directory: OSBindings/Mac run: xcodebuild CODE_SIGN_IDENTITY=- build-sdl: - name: Build SDL UI - runs-on: ubuntu-latest + name: SDL UI on ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 - name: Install dependencies + shell: bash run: | - sudo apt-get --allow-releaseinfo-change update - sudo apt-get --fix-missing install gcc-10 libsdl2-dev scons + case $RUNNER_OS in + Linux) + sudo apt-get --allow-releaseinfo-change update + sudo apt-get --fix-missing install gcc-10 libsdl2-dev scons + ;; + macOS) + brew install scons sdl2 + ;; + esac - name: Make working-directory: OSBindings/SDL - run: scons -j$(nproc --all) + shell: bash + run: | + case $RUNNER_OS in + Linux) + jobs=$(nproc --all) + ;; + macOS) + jobs=$(sysctl -n hw.activecpu) + ;; + *) + jobs=1 + esac + scons -j"$jobs"