-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `prepare-runner` GitHub action was getting bloated, so this decomposes it into smaller more granular and reusable actions instead. This should improve caching and reduce the amount of `apt-get`s being done.
- Loading branch information
1 parent
6458bb0
commit 6fe1c19
Showing
7 changed files
with
203 additions
and
122 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Setup Boxer | ||
description: | | ||
Installs prerequisites to be able to build and run Boxer. | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Update Apt | ||
if: runner.os == 'Linux' | ||
uses: ./.github/actions/update-apt | ||
|
||
# macOS and Windows both use builtin requirements for Boxer, so only the linux | ||
# runners need to install dependencies. | ||
- name: Install Boxer requirements | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get install -y -qq \ | ||
libgtk-3-dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Setup Clang | ||
description: | | ||
Prepares the runner image for compiling with `clang`. | ||
runs: | ||
using: composite | ||
steps: | ||
# ubuntu-latest, windows-latest, and macos-latest all come with cmake and | ||
# clang, so we don't need any of these base dependencies. | ||
# | ||
# See: | ||
# - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md | ||
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md | ||
# - https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md | ||
|
||
- name: Prepare compiler | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
run: | | ||
echo "CC=clang-18" >> "${GITHUB_ENV}" | ||
echo "CXX=clang++-18" >> "${GITHUB_ENV}" | ||
- name: Prepare compiler | ||
shell: bash | ||
if: runner.os == 'macOS' | ||
run: | | ||
echo "CC=$(brew --prefix llvm@18)/bin/clang" >> "${GITHUB_ENV}" | ||
echo "CXX=$(brew --prefix llvm@18)/bin/clang++" >> "${GITHUB_ENV}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Setup GLFW | ||
description: | | ||
Installs prerequisites to be able to build and run GLFW. | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Update Apt | ||
if: runner.os == 'Linux' | ||
uses: ./.github/actions/update-apt | ||
|
||
# macOS and Windows both use builtin requirements for GLFW, so only the linux | ||
# runners need to install dependencies. | ||
- name: Install GLFW requirements | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get install -y -qq \ | ||
libxrandr-dev \ | ||
libxinerama-dev \ | ||
libxcursor-dev \ | ||
libxi-dev \ | ||
libx11-dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Setup GLEW | ||
description: | | ||
Installs prerequisites to be able to build GLEW | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Update Apt | ||
if: runner.os == 'Linux' | ||
uses: ./.github/actions/update-apt | ||
|
||
# macOS and Windows both use builtin audio-requirements, so only the linux | ||
# runners need to install the audio dependencies in order to work. | ||
- name: Install OpenAL requirements | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
run: | | ||
# Install pulseaudio, portaudio, ALSA, JACK dependencies for | ||
# corresponding backends. | ||
# Install Qt5 dependency for alsoft-config. | ||
sudo apt-get install -y -qq \ | ||
libpulse-dev \ | ||
portaudio19-dev \ | ||
libasound2-dev \ | ||
libjack-dev \ | ||
qtbase5-dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Setup Vulkan | ||
description: | | ||
Installs prerequisites to be able to build Vulkan. | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Create Temp Directory | ||
shell: bash | ||
id: dir | ||
run: | | ||
path="${{ runner.temp }}/vulkan-sdk" | ||
mkdir -p "${path}" | ||
echo path="${path}" >> "${GITHUB_OUTPUT}" | ||
- name: Prepare download path | ||
shell: bash | ||
id: prepare | ||
run: | | ||
if [[ "${{ runner.os }}" == "Linux" ]]; then | ||
path="${{ steps.dir.outputs.path }}/vulkan-sdk.tar.xz" | ||
else | ||
path="${{ steps.dir.outputs.path }}/vulkan-sdk.dmg" | ||
fi | ||
echo "sdk-binary=${path}" >> "${GITHUB_OUTPUT}" | ||
- name: Cache vulkan-sdk | ||
uses: actions/cache@v4 | ||
id: cache-vulkan | ||
with: | ||
path: ${{ steps.prepare.outputs.sdk-binary }} | ||
key: vulkan-sdk-${{ runner.os }} | ||
|
||
- name: Download vulkan-sdk | ||
shell: bash | ||
if: steps.cache-vulkan.outputs.cache-hit != 'true' | ||
working-directory: "${{ steps.dir.outputs.path }}" | ||
id: download | ||
run: | | ||
if [[ "${{ runner.os }}" == "Linux" ]]; then | ||
wget https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.tar.xz | ||
else | ||
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg | ||
fi | ||
- name: Install Vulkan SDK (Linux) | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
working-directory: "${{ steps.dir.outputs.path }}" | ||
run: | | ||
tar -xf "${{ steps.download.outputs.path }}" | ||
export VULKAN_SDK=$(dirname "$(find . -type d -name "bin")") | ||
echo VULKAN_SDK="${VULKAN_SDK}" >> "${GITHUB_ENV}" | ||
echo LD_LIBRARY_PATH="${VULKAN_SDK}/lib:$LD_LIBRARY_PATH" >> "${GITHUB_ENV}" | ||
echo VK_ADD_LAYER_PATH="${VULKAN_SDK}/share/vulkan/explicit_layer.d${VK_ADD_LAYER_PATH:+:$VK_ADD_LAYER_PATH}" >> "${GITHUB_ENV}" | ||
echo "${VULKAN_SDK}/bin" >> "${GITHUB_PATH}" | ||
- name: Install Vulkan SDK (macOS) | ||
shell: bash | ||
if: runner.os == 'macOS' | ||
run: | | ||
hdiutil attach "${{ steps.download.outputs.path }}" -mountpoint vulkan-sdk | ||
vulkan_root="${HOME}/VulkanSDK" | ||
./vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan \ | ||
--root "${vulkan_root}" \ | ||
--accept-licenses \ | ||
--default-answer \ | ||
--confirm-command install | ||
export VULKAN_SDK="${vulkan_root}/macOS" | ||
echo VULKAN_SDK="${VULKAN_SDK}" >> "${GITHUB_ENV}" | ||
echo DYLD_LIBRARY_PATH="$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH" >> "${GITHUB_ENV}" | ||
echo LD_LIBRARY_PATH="$VULKAN_SDK/lib:$LD_LIBRARY_PATH" >> "${GITHUB_ENV}" | ||
echo VK_ICD_FILENAMES="$VULKAN_SDK/etc/vulkan/icd.d/MoltenVK_icd.json" >> "${GITHUB_ENV}" | ||
echo VK_LAYER_PATH="$VULKAN_SDK/share/vulkan/explicit_layer.d" >> "${GITHUB_ENV}" | ||
echo "$VULKAN_SDK/bin" >> "${GITHUB_PATH}" | ||
- name: Print SDK Contents | ||
shell: bash | ||
run: | | ||
find "${VULKAN_SDK}" -type f |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Update Apt | ||
description: | | ||
Updates the apt cache for the runner, caching whether the cache was already | ||
updated. If run on a non-Linux runner, this action will do nothing. | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Boxer requirements | ||
shell: bash | ||
if: runner.os == 'Linux' && env.APT_UPDATED != 'true' | ||
run: | | ||
sudo apt-get update -y -qq | ||
echo "APT_UPDATED=true" >> "${GITHUB_ENV}" |