Skip to content

Commit

Permalink
ci: Fix caching of object files in CD/CI (endless-sky#9282)
Browse files Browse the repository at this point in the history
  • Loading branch information
quyykk authored Sep 10, 2023
1 parent 638060a commit fc693ac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 28 deletions.
14 changes: 3 additions & 11 deletions .github/sccache/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: Install sccache
description: Installs sccache for the current platform
inputs:
read-only:
description: Whether the cache should be read-only
default: 'false'
runs:
using: 'composite'
steps:
- name: Set environment variables
run: echo "SCCACHE_VERSION=v0.5.4" >> $GITHUB_ENV
run: echo "SCCACHE_VERSION=v0.5.0" >> $GITHUB_ENV
shell: bash
- name: Download sccache
run: |
Expand All @@ -33,12 +29,8 @@ runs:
if: ${{ runner.os == 'Windows' }}
run: (Get-Item .).FullName >> $env:GITHUB_PATH
shell: pwsh
- name: Write to the cache
if: ${{ inputs.read-only == 'false' && github.event_name == 'push' }}
run: echo "SCCACHE_GHA_CACHE_TO=sccache-${{ github.sha }}" >> $GITHUB_ENV
shell: bash
- name: Read from the cache
run: echo "SCCACHE_GHA_CACHE_FROM=sccache-" >> $GITHUB_ENV
- name: Enable sccache
run: echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
shell: bash
- name: Configure sccache
uses: actions/github-script@v6
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
sudo apt-get install -y --no-install-recommends libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libgles2-mesa-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev
- name: Setup sccache
uses: ./.github/sccache
with:
read-only: 'true'
- name: Adjust version strings
run: ./utils/cd_update_versions.sh
- uses: lukka/get-cmake@latest
Expand Down Expand Up @@ -64,8 +62,6 @@ jobs:
show-progress: false
- name: Setup sccache
uses: ./.github/sccache
with:
read-only: 'true'
- name: Adjust version strings
run: ./utils/cd_update_versions.sh
shell: bash
Expand Down Expand Up @@ -99,8 +95,6 @@ jobs:
show-progress: false
- name: Setup sccache
uses: ./.github/sccache
with:
read-only: 'true'
- name: Install pkg-config
run: type -P pkg-config || brew install pkg-config
- uses: lukka/get-cmake@latest
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/cd_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
sudo apt-get install -y --no-install-recommends libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libgles2-mesa-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev
- name: Setup sccache
uses: ./.github/sccache
with:
read-only: 'true'
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
Expand Down Expand Up @@ -90,8 +88,6 @@ jobs:
show-progress: false
- name: Setup sccache
uses: ./.github/sccache
with:
read-only: 'true'
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
Expand Down Expand Up @@ -130,8 +126,6 @@ jobs:
show-progress: false
- name: Setup sccache
uses: ./.github/sccache
with:
read-only: 'true'
- name: Install pkg-config
run: type -P pkg-config || brew install pkg-config
- uses: lukka/get-cmake@latest
Expand Down
7 changes: 2 additions & 5 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON",
"ES_USE_SYSTEM_LIBRARIES": "OFF"
},
Expand All @@ -49,6 +50,7 @@
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON",
"ES_USE_SYSTEM_LIBRARIES": "OFF",
"BUILD_TESTING": "OFF"
},
Expand Down Expand Up @@ -182,7 +184,6 @@
"description": "Builds for Linux for CI purposes",
"inherits": "ci",
"cacheVariables": {
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"VCPKG_HOST_TRIPLET": "linux64-release",
"VCPKG_TARGET_TRIPLET": "linux64-release",
"ES_USE_OFFSCREEN": "ON"
Expand All @@ -194,7 +195,6 @@
"description": "Builds for Linux GLES for CI purposes",
"inherits": "ci",
"cacheVariables": {
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"VCPKG_HOST_TRIPLET": "linux64-release",
"VCPKG_TARGET_TRIPLET": "linux64-release",
"ES_GLES": "ON",
Expand All @@ -207,7 +207,6 @@
"description": "Builds for MacOS for CI purposes",
"inherits": "ci",
"cacheVariables": {
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"VCPKG_HOST_TRIPLET": "macos64-release",
"VCPKG_TARGET_TRIPLET": "macos64-release",
"CMAKE_OSX_ARCHITECTURES": "x86_64",
Expand All @@ -220,7 +219,6 @@
"description": "Builds with clang-cl for CI purposes",
"inherits": "ci",
"cacheVariables": {
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"VCPKG_HOST_TRIPLET": "x64-windows-release",
"VCPKG_TARGET_TRIPLET": "x64-windows-release",
"CMAKE_CXX_COMPILER": "clang-cl.exe"
Expand All @@ -232,7 +230,6 @@
"description": "Builds with MinGW for CI purposes",
"inherits": "ci",
"cacheVariables": {
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER": "x86_64-w64-mingw32-g++",
"CMAKE_RC_COMPILER": "windres",
"VCPKG_HOST_TRIPLET": "win64-release",
Expand Down

0 comments on commit fc693ac

Please sign in to comment.