Skip to content

Commit e1fe742

Browse files
committed
ci: Make separate download/upload options for ccache
1 parent fb1cdcb commit e1fe742

File tree

6 files changed

+37
-15
lines changed

6 files changed

+37
-15
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ jobs:
6262
container: ${{ matrix.container }}
6363
conan_profile: ${{ matrix.conan_profile }}
6464
build_type: ${{ matrix.build_type }}
65+
download_ccache: true
66+
upload_ccache: true
6567
static: ${{ matrix.static }}
6668
run_unit_tests: true
6769
run_integration_tests: false
@@ -76,7 +78,8 @@ jobs:
7678
container: '{ "image": "ghcr.io/xrplf/clio-ci:384e79cd32f5f6c0ab9be3a1122ead41c5a7e67d" }'
7779
conan_profile: gcc
7880
build_type: Debug
79-
disable_cache: false
81+
download_ccache: true
82+
upload_ccache: false
8083
code_coverage: true
8184
static: true
8285
upload_clio_server: false
@@ -94,7 +97,8 @@ jobs:
9497
container: '{ "image": "ghcr.io/xrplf/clio-ci:384e79cd32f5f6c0ab9be3a1122ead41c5a7e67d" }'
9598
conan_profile: gcc
9699
build_type: Release
97-
disable_cache: false
100+
download_ccache: true
101+
upload_ccache: false
98102
code_coverage: false
99103
static: true
100104
upload_clio_server: false

.github/workflows/build_and_test.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ on:
2323
required: true
2424
type: string
2525

26-
disable_cache:
27-
description: Whether ccache should be disabled
26+
download_ccache:
27+
description: Whether to download ccache from the cache
28+
required: false
29+
type: boolean
30+
default: true
31+
32+
upload_ccache:
33+
description: Whether to upload ccache to the cache
2834
required: false
2935
type: boolean
3036
default: false
@@ -77,7 +83,8 @@ jobs:
7783
container: ${{ inputs.container }}
7884
conan_profile: ${{ inputs.conan_profile }}
7985
build_type: ${{ inputs.build_type }}
80-
disable_cache: ${{ inputs.disable_cache }}
86+
download_ccache: ${{ inputs.download_ccache }}
87+
upload_ccache: ${{ inputs.upload_ccache }}
8188
code_coverage: false
8289
static: ${{ inputs.static }}
8390
upload_clio_server: ${{ inputs.upload_clio_server }}

.github/workflows/build_impl.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ on:
2323
required: true
2424
type: string
2525

26-
disable_cache:
27-
description: Whether ccache should be disabled
26+
download_ccache:
27+
description: Whether to download ccache from the cache
2828
required: false
2929
type: boolean
30+
default: true
31+
32+
upload_ccache:
33+
description: Whether to upload ccache to the cache
34+
required: false
35+
type: boolean
36+
default: false
3037

3138
code_coverage:
3239
description: Whether to enable code coverage
@@ -90,15 +97,15 @@ jobs:
9097
- name: Prepare runner
9198
uses: XRPLF/actions/.github/actions/prepare-runner@7951b682e5a2973b28b0719a72f01fc4b0d0c34f
9299
with:
93-
disable_ccache: ${{ inputs.disable_cache }}
100+
disable_ccache: ${{ !inputs.download_ccache }}
94101

95102
- name: Setup conan on macOS
96103
if: ${{ runner.os == 'macOS' }}
97104
shell: bash
98105
run: ./.github/scripts/conan/init.sh
99106

100107
- name: Restore cache
101-
if: ${{ !inputs.disable_cache }}
108+
if: ${{ inputs.download_ccache }}
102109
uses: ./.github/actions/restore_cache
103110
id: restore_cache
104111
with:
@@ -144,7 +151,7 @@ jobs:
144151
path: build_time_report.txt
145152

146153
- name: Show ccache's statistics
147-
if: ${{ !inputs.disable_cache }}
154+
if: ${{ inputs.download_ccache }}
148155
shell: bash
149156
id: ccache_stats
150157
run: |
@@ -190,7 +197,7 @@ jobs:
190197
path: build/*.deb
191198

192199
- name: Save cache
193-
if: ${{ !inputs.disable_cache && github.ref == 'refs/heads/develop' }}
200+
if: ${{ inputs.upload_ccache && github.ref == 'refs/heads/develop' }}
194201
uses: ./.github/actions/save_cache
195202
with:
196203
conan_profile: ${{ inputs.conan_profile }}

.github/workflows/nightly.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
run_unit_tests: true
6262
run_integration_tests: true
6363
upload_clio_server: true
64-
disable_cache: true
64+
download_ccache: false
65+
upload_ccache: false
6566

6667
analyze_build_time:
6768
name: Analyze Build Time
@@ -84,7 +85,8 @@ jobs:
8485
container: ${{ matrix.container }}
8586
conan_profile: ${{ matrix.conan_profile }}
8687
build_type: Release
87-
disable_cache: true
88+
download_ccache: false
89+
upload_ccache: false
8890
code_coverage: false
8991
static: ${{ matrix.static }}
9092
upload_clio_server: false

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ jobs:
4141
run_unit_tests: true
4242
run_integration_tests: true
4343
upload_clio_server: true
44-
disable_cache: true
44+
download_ccache: false
45+
upload_ccache: false
4546
expected_version: ${{ github.event_name == 'push' && github.ref_name || '' }}
4647

4748
release:

.github/workflows/sanitizers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545
with:
4646
runs_on: heavy
4747
container: '{ "image": "ghcr.io/xrplf/clio-ci:384e79cd32f5f6c0ab9be3a1122ead41c5a7e67d" }'
48-
disable_cache: true
48+
download_ccache: false
49+
upload_ccache: false
4950
conan_profile: ${{ matrix.compiler }}${{ matrix.sanitizer_ext }}
5051
build_type: ${{ matrix.build_type }}
5152
static: false

0 commit comments

Comments
 (0)