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

Add Apple Silicon Build #969

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
72 changes: 59 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,94 @@ concurrency:

jobs:
build:
name: "Build ${{ matrix.platform }} in ${{ matrix.build_type }}"
name: "Build ${{ matrix.platform.runtime }} in ${{ matrix.build_type }}"
strategy:
matrix:
platform: [windows, ubuntu, macos]
platform: [{ os: windows, runtime: windows-latest }, { os: ubuntu, runtime: ubuntu-latest }, { os: macos, runtime: macos-12 }]
build_type: [Debug, Release]
env:
PARALLEL: -j 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, instead of duplicating most of this file, you could add macos-14 to the matrix and just have a condition here like
if: ${{ github.ref == 'refs/heads/main' || matrix.platform.runtime != 'macos-14' }}

runs-on: "${{ matrix.platform }}-latest"
runs-on: "${{ matrix.platform.runtime }}"
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- if: ${{ matrix.platform == 'ubuntu' }}
- if: ${{ matrix.platform.os == 'ubuntu' }}
name: Install RandR headers
run: |
sudo apt-get update
sudo apt install xorg-dev libglu1-mesa-dev
- if: ${{ matrix.platform == 'windows' }}
- if: ${{ matrix.platform.os == 'windows' }}
name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- if: ${{ matrix.platform == 'windows' }}
- if: ${{ matrix.platform.os == 'windows' }}
name: sccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
variant: sccache
- if: ${{ matrix.platform != 'windows' }}
- if: ${{ matrix.platform.os != 'windows' }}
name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
- if: ${{ matrix.platform == 'windows' }}
- if: ${{ matrix.platform.os == 'windows' }}
name: Configure and build
shell: pwsh
run: |
cmake -B"build/${{ matrix.platform }}" -G"Ninja" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache
cmake --build "build/${{ matrix.platform }}" --target vulkan_samples --config ${{ matrix.build_type }} -j 1
- if: ${{ matrix.platform != 'windows' }}
cmake -B"build/${{ matrix.platform.os }}" -G"Ninja" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} -j 1
- if: ${{ matrix.platform.os != 'windows' }}
name: Configure and build
run: |
cmake -B"build/${{ matrix.platform }}" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON
cmake --build "build/${{ matrix.platform }}" --target vulkan_samples --config ${{ matrix.build_type }} ${{ env.PARALLEL }}
cmake -B"build/${{ matrix.platform.os }}" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} ${{ env.PARALLEL }}

build_apple_silicon:
name: "Build Apple Silicon in ${{ matrix.build_type }}"
strategy:
matrix:
platform: [{ os: macos, runtime: macos-14 }]
build_type: [Debug, Release]
env:
PARALLEL: -j 2
# Only run on main due to provisioning time for Apple Silicon runners
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: "${{ matrix.platform.runtime }}"
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- if: ${{ matrix.platform.os == 'ubuntu' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I get it right, this part is only used with platform = { macos, macos-14 }?
That is, all those matrix.platform.os == 'ubuntu' or 'windows' parts should not be needed here?

name: Install RandR headers
run: |
sudo apt-get update
sudo apt install xorg-dev libglu1-mesa-dev
- if: ${{ matrix.platform.os == 'windows' }}
name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- if: ${{ matrix.platform.os == 'windows' }}
name: sccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
variant: sccache
- if: ${{ matrix.platform.os != 'windows' }}
name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
- if: ${{ matrix.platform.os == 'windows' }}
name: Configure and build
shell: pwsh
run: |
cmake -B"build/${{ matrix.platform.os }}" -G"Ninja" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} -j 1
- if: ${{ matrix.platform.os != 'windows' }}
name: Configure and build
run: |
cmake -B"build/${{ matrix.platform.os }}" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} ${{ env.PARALLEL }}

build_d2d:
name: "Build Ubuntu with Direct To Display"
Expand Down
Loading