Skip to content

Commit 8151f8f

Browse files
committed
ci: Use ccache for Linux, MacOS jobs
1 parent b40b4af commit 8151f8f

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

.github/parameters/macports.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ ports:
1212
- name: luajit
1313
- name: flac
1414
- name: dylibbundler
15-
- name: tree
15+
- name: tree
16+
- name: ccache

.github/workflows/meson.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ jobs:
6262
- name: Install Dependencies
6363
run: |
6464
sudo apt-get update -yq
65-
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev libtbb-dev libsdl2-dev libsdl2-image-dev libopengl-dev libfuse2 ninja-build
65+
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev libtbb-dev libsdl2-dev libsdl2-image-dev libopengl-dev libfuse2 ninja-build ccache
6666
sudo pip install meson
6767
68+
- name: ccache
69+
uses: hendrikmuhs/[email protected]
70+
with:
71+
key: ${{ github.job }}-${{ matrix.os }}
72+
6873
- name: Set Version
6974
if: ${{inputs.new_release_version}}
7075
uses: ./.github/actions/set_version
@@ -74,22 +79,22 @@ jobs:
7479

7580
- name: Setup Meson
7681
env:
77-
CC: "gcc"
78-
CXX: "g++"
82+
CC: "ccache gcc"
83+
CXX: "ccache g++"
7984
run: |
8085
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=true build
8186
8287
- name: Configure for AppImage
8388
if: ${{inputs.upload_artefacts}}
8489
env:
85-
CC: "gcc"
86-
CXX: "g++"
90+
CC: "ccache gcc"
91+
CXX: "ccache g++"
8792
run: meson configure -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build
8893

8994
- name: Build
9095
env:
91-
CC: "gcc"
92-
CXX: "g++"
96+
CC: "ccache gcc"
97+
CXX: "ccache g++"
9398
run: |
9499
meson compile -C build
95100
@@ -147,19 +152,24 @@ jobs:
147152
new_release_version: ${{inputs.new_release_version}}
148153
github_token: ${{ secrets.GITHUB_TOKEN }}
149154

155+
- name: ccache
156+
uses: hendrikmuhs/[email protected]
157+
with:
158+
key: ${{ github.job }}-${{ matrix.os }}
159+
150160
- name: Setup Meson
151161
env:
152-
CC: "gcc-${{env.GCC_VERSION}}"
153-
CXX: "g++-${{env.GCC_VERSION}}"
162+
CC: "ccache gcc-${{env.GCC_VERSION}}"
163+
CXX: "ccache g++-${{env.GCC_VERSION}}"
154164
LDFLAGS: "-static-libgcc -static-libstdc++"
155165
run: |
156166
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false build
157167
158168
- name: Configure for App Bundle
159169
if: ${{inputs.upload_artefacts}}
160170
env:
161-
CC: "gcc-${{env.GCC_VERSION}}"
162-
CXX: "g++-${{env.GCC_VERSION}}"
171+
CC: "ccache gcc-${{env.GCC_VERSION}}"
172+
CXX: "ccache g++-${{env.GCC_VERSION}}"
163173
LDFLAGS: "-static-libgcc -static-libstdc++"
164174
run: |
165175
meson configure \
@@ -170,8 +180,8 @@ jobs:
170180
171181
- name: Build
172182
env:
173-
CC: "gcc-${{env.GCC_VERSION}}"
174-
CXX: "g++-${{env.GCC_VERSION}}"
183+
CC: "ccache gcc-${{env.GCC_VERSION}}"
184+
CXX: "ccache g++-${{env.GCC_VERSION}}"
175185
LDFLAGS: "-static-libgcc -static-libstdc++"
176186
run: |
177187
meson compile -C build

0 commit comments

Comments
 (0)