ci: add sccache

This commit is contained in:
Cappy Ishihara
2025-11-26 19:59:13 +07:00
parent dcaa615162
commit 359dd1a71c
+15
View File
@@ -30,6 +30,10 @@ on:
type: boolean
default: true
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: on
jobs:
build:
strategy:
@@ -63,6 +67,17 @@ jobs:
run: |
dir=$(dirname ${{ matrix.pkg.pkg }})
dnf5 builddep -y ${dir}/*.spec
# todo: probably add sccache in the builder image
dnf5 install -y sccache
- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('SCCACHE_GHA_VERSION', `${{ matrix.pkg.pkg }}-${{ matrix.version }}-${{ matrix.pkg.arch }}`);
core.exportVariable('SCCACHE_GHA_CACHE_FROM', `${{ matrix.pkg.pkg }}-${{ matrix.version }}-${{ matrix.pkg.arch }}`);
- 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' || '' }}