feat: add 'use-sccache' input to build workflows for improved caching options

This commit is contained in:
mr. M
2025-04-01 19:34:31 +02:00
parent fea803d4ce
commit dfc9119bbc
5 changed files with 39 additions and 6 deletions

View File

@@ -22,6 +22,11 @@ on:
type: string
required: true
default: ''
use-sccache:
description: 'Use sccache'
required: true
type: boolean
default: false
jobs:
windows-build:
@@ -29,9 +34,9 @@ jobs:
# aarch64 does not need full 16x, and we also dont use full LTO when generating GPO
runs-on: ${{ (inputs.release-branch == 'release' && !inputs.generate-gpo && matrix.arch == 'x86_64') && 'self-hosted' || 'ubuntu-latest' }}
env:
SCCACHE_GHA_ENABLED: 'true'
SCCACHE_GHA_ENABLED: ${ inputs.use-sccache }
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: 'sccache'
RUSTC_WRAPPER: ${ inputs.use-sccache && 'sccache' || '' }
CARGO_INCREMENTAL: 0
strategy:
fail-fast: false
@@ -62,6 +67,7 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@main
if: ${{ inputs.use-sccache }}
with:
disable_annotations: true