🏗️ CI Build #103
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
# Cross-platform and multi-configuration build of the Methane Asteroids | |
name: '🏗️ CI Build' | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main, develop ] | |
paths: | |
- '.github/**/*.yml' | |
- 'Apps/**' | |
- 'Modules/**' | |
- 'Externals/**' | |
- 'CMake/**' | |
- 'Build/*/CI/**' | |
- 'CMakeLists.txt' | |
- 'CMakePresets.json' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '.github/**/*.yml' | |
- 'Apps/**' | |
- 'Modules/**' | |
- 'Externals/**' | |
- 'CMake/**' | |
- 'Build/*/CI/**' | |
- 'CMakeLists.txt' | |
- 'CMakePresets.json' | |
schedule: | |
- cron: '20 23 * * 3' # Scheduled workflow will not run in GitHub forks by default | |
env: | |
METHANE_VERSION_MAJOR: 0 | |
METHANE_VERSION_MINOR: 8 | |
METHANE_VERSION_PATCH: 0 | |
METHANE_VERSION_BUILD: ${{ github.run_number }} | |
TRACY_RELEASE_VERSION: "0.11.2.1" | |
VULKAN_SDK_VERSION: "1.3.290.0" | |
ORIGIN_REPOSITORY: 'MethanePowered/MethaneAsteroids' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
name: "Win64_DX_Release" | |
config_preset: "VS2022-Win64-DX-Default" | |
build_preset: "VS2022-Win64-DX-Release" | |
named_logo: Windows | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: windows-latest | |
name: "Win64_VK_Release" | |
config_preset: "VS2022-Win64-VK-Default" | |
build_preset: "VS2022-Win64-VK-Release" | |
named_logo: Windows | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: windows-latest | |
name: "Win64_DX_Profile" | |
config_preset: "VS2022-Win64-DX-Profile" | |
build_preset: "VS2022-Win64-DX-Profile" | |
named_logo: Windows | |
add_tracy_app: true | |
install_vulkan_sdk: false | |
- os: windows-latest | |
name: "Win64_VK_Profile" | |
config_preset: "VS2022-Win64-VK-Profile" | |
build_preset: "VS2022-Win64-VK-Profile" | |
named_logo: Windows | |
add_tracy_app: true | |
install_vulkan_sdk: false | |
- os: windows-latest | |
name: "Win32_DX_Release" | |
config_preset: "VS2022-Win32-DX-Default" | |
build_preset: "VS2022-Win32-DX-Release" | |
named_logo: Windows | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: windows-latest | |
name: "Win32_VK_Release" | |
config_preset: "VS2022-Win32-VK-Default" | |
build_preset: "VS2022-Win32-VK-Release" | |
named_logo: Windows | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: windows-latest | |
name: "Win32_DX_Profile" | |
config_preset: "VS2022-Win32-DX-Profile" | |
build_preset: "VS2022-Win32-DX-Profile" | |
named_logo: Windows | |
add_tracy_app: true | |
install_vulkan_sdk: false | |
- os: windows-latest | |
name: "Win32_VK_Profile" | |
config_preset: "VS2022-Win32-VK-Profile" | |
build_preset: "VS2022-Win32-VK-Profile" | |
named_logo: Windows | |
add_tracy_app: true | |
install_vulkan_sdk: false | |
- os: ubuntu-latest | |
name: "Ubuntu_VK_Release" | |
config_preset: "Make-Lin-VK-Release" | |
build_preset: "Make-Lin-VK-Release" | |
named_logo: Linux | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: ubuntu-latest | |
name: "Ubuntu_VK_Profile" | |
config_preset: "Make-Lin-VK-Profile" | |
build_preset: "Make-Lin-VK-Profile" | |
named_logo: Linux | |
add_tracy_app: true | |
install_vulkan_sdk: false | |
- os: macos-latest | |
name: "MacOS_Arm64_VK_Release" | |
config_preset: "Xcode-Mac-Arm64-VK-Default" | |
build_preset: "Xcode-Mac-Arm64-VK-Release" | |
named_logo: Apple | |
add_tracy_app: false | |
install_vulkan_sdk: true | |
- os: macos-latest | |
name: "MacOS_x86-64_VK_Release" | |
config_preset: "Xcode-Mac-x86-64-VK-Default" | |
build_preset: "Xcode-Mac-x86-64-VK-Release" | |
named_logo: Apple | |
add_tracy_app: false | |
install_vulkan_sdk: true | |
- os: macos-latest | |
name: "MacOS_Arm64_MTL_Release" | |
config_preset: "Xcode-Mac-Arm64-MTL-Default" | |
build_preset: "Xcode-Mac-Arm64-MTL-Release" | |
named_logo: Apple | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: macos-latest | |
name: "MacOS_Arm64_MTL_Profile" | |
config_preset: "Xcode-Mac-Arm64-MTL-Profile" | |
build_preset: "Xcode-Mac-Arm64-MTL-Profile" | |
named_logo: Apple | |
add_tracy_app: true | |
install_vulkan_sdk: false | |
- os: macos-latest | |
name: "MacOS_x86-64_MTL_Release" | |
config_preset: "Xcode-Mac-x86-64-MTL-Default" | |
build_preset: "Xcode-Mac-x86-64-MTL-Release" | |
named_logo: Apple | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: macos-latest | |
name: "MacOS_x86-64_MTL_Profile" | |
config_preset: "Xcode-Mac-x86-64-MTL-Profile" | |
build_preset: "Xcode-Mac-x86-64-MTL-Profile" | |
named_logo: Apple | |
add_tracy_app: true | |
install_vulkan_sdk: false | |
- os: macos-latest | |
name: "iOS_Sim_MTL_Release" | |
config_preset: "Xcode-iOS-Sim-MTL-Default" | |
build_preset: "Xcode-iOS-Sim-MTL-Release" | |
named_logo: Apple | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
- os: macos-latest | |
name: "tvOS_Sim_MTL_Release" | |
config_preset: "Xcode-tvOS-Sim-MTL-Default" | |
build_preset: "Xcode-tvOS-Sim-MTL-Release" | |
named_logo: Apple | |
add_tracy_app: false | |
install_vulkan_sdk: false | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
env: | |
INSTALL_DIR: Build/Output/${{ matrix.config_preset }}/Install | |
BUILD_LOG_FILE: Build/Output/${{ matrix.config_preset }}/Install/Build.log | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Configure long paths on Windows | |
if: ${{ runner.os == 'Windows' }} | |
shell: pwsh | |
run: | | |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force | |
git config --system core.longpaths true | |
- name: Install Linux prerequisites | |
if: ${{ runner.os == 'Linux' }} | |
run: ./Build/Unix/CI/InstallLinuxPrerequisites.sh | |
- name: Install Vulkan SDK ${{ env.VULKAN_SDK_VERSION }} | |
if: ${{ matrix.install_vulkan_sdk }} | |
run: ./Build/Unix/CI/InstallVulkanSdk.sh "${{ env.VULKAN_SDK_VERSION }}" "${{ runner.tool_cache }}/VulkanSDK" | |
- name: Initialize Externals Cache | |
uses: actions/cache@v4 | |
with: | |
path: Build/Output/ExternalsCache | |
key: ExternalsCache-${{ matrix.config_preset }}-${{ hashFiles('Externals/*.cmake') }} | |
- name: CMake Configure Preset ${{ matrix.config_preset }} | |
shell: bash | |
run: ./Build/Unix/CI/CMakeConfigurePreset.sh "${{ matrix.config_preset }}" | |
- name: CMake Build Preset ${{ matrix.build_preset }} | |
shell: bash | |
run: ./Build/Unix/CI/CMakeBuildPreset.sh "${{ matrix.build_preset }}" | |
- name: Add README and Build-Info files | |
if: ${{ success() || failure() }} | |
shell: bash | |
env: | |
REPO_URL: ${{ github.repositoryUrl }} | |
BRANCH_NAME: ${{ github.ref_name }} | |
COMMIT_SHA: ${{ github.sha }} | |
RUN_ID: ${{ github.run_id }} | |
CONFIG_PRESET: ${{ matrix.config_preset }} | |
BUILD_PRESET: ${{ matrix.build_preset }} | |
RUNNER_INFO: "${{ runner.name }}, ${{ runner.os }}, ${{ runner.arch }}" | |
run: | | |
cp README.md $INSTALL_DIR/README.md | |
./Build/Unix/CI/WriteBuildInfo.sh "$INSTALL_DIR/Build-Info.txt" | |
- name: Download Tracy release | |
if: ${{ matrix.add_tracy_app && (success() || failure()) }} | |
shell: bash | |
run: ./Build/Unix/CI/DownloadTracyRelease.sh "${{ env.TRACY_RELEASE_VERSION }}" "$INSTALL_DIR/Apps" | |
- name: Archive Build Artifacts | |
if: ${{ success() || failure() }} | |
shell: bash | |
working-directory: ${{ env.INSTALL_DIR }} | |
run: 7z a -t7z -mx=9 MethaneAsteroids_${{ matrix.name }}.7z * | |
- name: Upload Archived Build Artifacts | |
if: ${{ success() || failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MethaneAsteroids_${{ matrix.name }}_${{ env.METHANE_VERSION_MAJOR }}.${{ env.METHANE_VERSION_MINOR }}.${{ env.METHANE_VERSION_PATCH }}.${{ env.METHANE_VERSION_BUILD }} | |
path: ${{ env.INSTALL_DIR }}/MethaneAsteroids_${{ matrix.name }}.7z |