Use ccache-action on linux too

This commit is contained in:
Bruno Alexandre Rosa 2025-09-25 07:56:09 -03:00
parent 155894ec9c
commit 9fa149b595

View file

@ -135,7 +135,6 @@ jobs:
continue-on-error: ${{matrix.allow-failure == 'yes'}} continue-on-error: ${{matrix.allow-failure == 'yes'}}
env: env:
NAME: ${{matrix.distro}}${{matrix.version}} NAME: ${{matrix.distro}}${{matrix.version}}
CACHE: ${{github.workspace}}/.cache/${{matrix.distro}}${{matrix.version}} # directory for caching docker image and ccache
# Cache size over the entire repo is 10Gi: # Cache size over the entire repo is 10Gi:
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
CCACHE_SIZE: 500M CCACHE_SIZE: 500M
@ -145,15 +144,14 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v5
- name: Restore compiler cache (ccache) - name: Setup ccache
id: ccache_restore uses: jianmingyong/ccache-action@v1
uses: actions/cache/restore@v4
env: env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with: with:
path: ${{env.CACHE}} install-type: "binary"
key: ccache-${{matrix.distro}}${{matrix.version}}-${{env.BRANCH_NAME}} ccache-key-prefix: ccache-${{matrix.distro}}${{matrix.version}}-${{env.BRANCH_NAME}}
restore-keys: ccache-${{matrix.distro}}${{matrix.version}}- gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{matrix.distro}} ${{matrix.version}} Docker image - name: Build ${{matrix.distro}} ${{matrix.version}} Docker image
shell: bash shell: bash
@ -183,13 +181,6 @@ jobs:
--ccache "$CCACHE_SIZE" --ccache "$CCACHE_SIZE"
.ci/name_build.sh .ci/name_build.sh
- name: Save compiler cache (ccache)
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@v4
with:
path: ${{env.CACHE}}
key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
- name: Upload artifact - name: Upload artifact
id: upload_artifact id: upload_artifact
if: matrix.package != 'skip' if: matrix.package != 'skip'