diff --git a/.github/workflows/json-build.yml b/.github/workflows/json-build.yml index 536d2d5d54..f6264befb2 100644 --- a/.github/workflows/json-build.yml +++ b/.github/workflows/json-build.yml @@ -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' || '' }}