Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
sccache:
description: Use the sccache compilation cache
type: boolean
default: true

permissions:
contents: read
Expand All @@ -21,13 +26,16 @@ jobs:
AEGISUB_BUILD_BRANCH: ${{ github.head_ref || github.ref_name }}
# Same condition as windows-sign-executable
AEGISUB_SIGN_WINDOWS: ${{ matrix.config.os == 'windows-latest' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/ci/windows-signing') }}
SCCACHE_GHA_ENABLED: "true"
SCCACHE_C_CUSTOM_CACHE_BUSTER: ${{ matrix.config['sccache-key'] }}

strategy:
fail-fast: false
matrix:
config:
- name: Windows MSVC Release
os: windows-latest
sccache-key: windows-x86_64-msvc
msvc: true
devenv: |
Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Expand All @@ -49,17 +57,22 @@ jobs:
-Dlibass:fontconfig=disabled
- name: Ubuntu Debug
os: ubuntu-latest
sccache-key: linux-x86_64-gcc
buildtype: debugoptimized
args: -Db_pch=false
- name: Ubuntu Release
os: ubuntu-latest
sccache-key: linux-x86_64-gcc
buildtype: release
args: -Db_pch=false
- name: macOS x86_64 Release
os: macos-15
cross_args: --cross-file tools/macos-release.ini --cross-file tools/macos-x86_64.ini
sccache-key: macos-x86_64-clang
cross_args: --cross-file tools/macos-release.ini --cross-file tools/macos-x86_64.ini --cross-file tools/sccache.ini
buildtype: release
# sccache serves clang PCHs that fail mtime validation on a fresh checkout
args: &macos_source_args >-
-Db_pch=false
-Ddefault_library=static
-Dbuild_osx_bundle=true
-Dfftw3=disabled
Expand Down Expand Up @@ -88,15 +101,18 @@ jobs:
--force-fallback-for=boost,wxWidgets,libass,zlib,freetype2,fribidi,harfbuzz,ffms2,libavformat,libavcodec,libswscale,libavutil,libswresample,dav1d,hunspell,uchardet,icu-uc,icu-i18n,libcurl
- name: macOS arm64 Debug
os: macos-15
sccache-key: macos-arm64-clang
buildtype: debugoptimized
args: >-
-Db_pch=false
-Dmacos_deployment_target=15.0
-Dbuild_osx_bundle=false
-Dfftw3=enabled
-Dlibpulse=disabled
-Dopenal=enabled
- name: macOS arm64 Release
os: macos-15
sccache-key: macos-arm64-clang
native_args: --native-file tools/macos-release.ini
buildtype: release
args: *macos_source_args
Expand All @@ -110,6 +126,11 @@ jobs:
with:
python-version: '3.x'

# Release builds compile from scratch; manual runs can opt out too
- name: Set up sccache
if: github.ref_type != 'tag' && (github.event_name != 'workflow_dispatch' || inputs.sccache)
uses: mozilla-actions/sccache-action@v0.0.11

- name: Setup Meson
run: |
python -m pip install --upgrade pip setuptools
Expand Down
12 changes: 8 additions & 4 deletions tools/macos-x86_64.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Build Intel binaries with native Apple Silicon tools; run tests via Rosetta.
# Combine with macos-release.ini for target dependency search paths.
[constants]
# Overridden by tools/sccache.ini when layered after this file
compiler_cache = []

[binaries]
c = ['/usr/bin/clang', '-arch', 'x86_64']
cpp = ['/usr/bin/clang++', '-arch', 'x86_64']
objc = ['/usr/bin/clang', '-arch', 'x86_64']
objcpp = ['/usr/bin/clang++', '-arch', 'x86_64']
c = compiler_cache + ['/usr/bin/clang', '-arch', 'x86_64']
cpp = compiler_cache + ['/usr/bin/clang++', '-arch', 'x86_64']
objc = compiler_cache + ['/usr/bin/clang', '-arch', 'x86_64']
objcpp = compiler_cache + ['/usr/bin/clang++', '-arch', 'x86_64']
ar = '/usr/bin/ar'
strip = '/usr/bin/strip'
pkg-config = 'pkg-config'
Expand Down
5 changes: 5 additions & 0 deletions tools/sccache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Layer after a cross file that defines compiler_cache (e.g. macos-x86_64.ini)
# to compile through sccache. Meson only adds sccache automatically for
# compilers it finds itself, not ones listed in machine files.
[constants]
compiler_cache = ['sccache']
Loading