Skip to content

Commit

Permalink
use ccache on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
cgytrus committed Aug 1, 2023
1 parent eea6d17 commit 10baedb
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- '!no-build-**' # unless marked as no-build

env:
CCACHE_ACTION_CI: true
SCCACHE_GHA_ENABLED: "on"

jobs:
Expand All @@ -22,18 +23,20 @@ jobs:
fail-fast: false
matrix:
config:
- name: "Windows"
os_identifier: "win"
- name: Windows
os: windows-latest
os_identifier: win
cache_variant: sccache
extra_flags: '-T host=x86 -A win32 -DGEODE_DEBUG=On'
cli_cmd: ''
package_cmd: 'makensis -WX -V3 ./installer/windows/installer.nsi'
installer_path: './installer/windows/geode-installer-win.exe'

- name: "macOS"
os_identifier: "mac"
- name: macOS
os: macos-latest
extra_flags: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DGEODE_DEBUG=On -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
os_identifier: mac
cache_variant: ccache
extra_flags: '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DGEODE_DEBUG=On -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13'
cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode'
package_cmd: './installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg'
installer_path: './installer/mac/geode-installer-mac.pkg'
Expand All @@ -46,11 +49,10 @@ jobs:
with:
submodules: recursive

- name: Configure cache
uses: hendrikmuhs/ccache-action@v1
- uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.config.os }}
variant: sccache
variant: ${{ matrix.config.cache_variant }}

- uses: ilammy/msvc-dev-cmd@v1
with:
Expand All @@ -62,7 +64,7 @@ jobs:
with:
repository: geode-sdk/cli
latest: true
fileName: "*-${{ matrix.config.os_identifier }}.zip"
fileName: '*-${{ matrix.config.os_identifier }}.zip'
tarBall: false
zipBall: false
out-file-path: "cli"
Expand All @@ -75,15 +77,16 @@ jobs:
- name: Configure CMake
run: >
cmake -B ${{ github.workspace }}/build
cmake
${{ matrix.config.extra_flags }}
-DCLI_PATH="${{ github.workspace }}/cli"
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.config.cache_variant }}
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.config.cache_variant }}
-B ${{ github.workspace }}/build
- name: Build
run: |
cd build
cd ${{ github.workspace }}/build
cmake --build . --config RelWithDebInfo --parallel
- name: Delete resource cache file
Expand Down

0 comments on commit 10baedb

Please sign in to comment.