ci: add sccache [part 1] (#7704) (#7706)

This commit is contained in:
madomado
2025-11-29 22:06:32 +08:00
committed by GitHub
parent 7006488e11
commit cb17fcce14
3 changed files with 283 additions and 0 deletions
+16
View File
@@ -18,6 +18,11 @@ on:
required: false
type: string
default: ""
bust_cache:
description: "Whether to bust the cache"
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
packages:
@@ -30,6 +35,14 @@ on:
type: boolean
default: true
env:
RUSTC_WRAPPER: sccache
# SCCACHE_NO_DAEMON: "1"
# Disable incremental compilation so sccache works better
CARGO_INCREMENTAL: "false"
SCCACHE_GHA_ENABLED: "true"
SCCACHE_RECACHE: "${{ inputs.bust_cache == 'true' && 'true' || '' }}"
jobs:
build:
strategy:
@@ -64,6 +77,9 @@ jobs:
dir=$(dirname ${{ matrix.pkg.pkg }})
dnf5 builddep -y ${dir}/*.spec
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Build with Andaman
run: anda build -D "vendor Terra" ${{ matrix.pkg.pkg }} -c terra-${{ matrix.version }}-${{ matrix.pkg.arch }} ${{ !matrix.pkg.labels.mock == '1' && '-rrpmbuild' || '' }}