Github Actions cache doesn't permit to overwrite cache if it does
already exist. As a trick to refresh and have fresh ccache pool,
delete the ccache cache if it does exist with the help of Github REST
API. An additional permission is needed to access this API. Add this
permittion to each user of the build workflow.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
steps:
- name: Checkout master directory
steps:
- name: Checkout master directory
name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs
path: "openwrt/logs"
name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs
path: "openwrt/logs"
+ - name: Delete already present ccache cache
+ if: steps.restore-ccache-cache.outputs.cache-hit == 'true'
+ uses: octokit/request-action@v2.x
+ with:
+ route: DELETE /repos/{repository}/actions/caches?key={key}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ INPUT_REPOSITORY: ${{ github.repository }}
+ INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }}
+
- name: Save ccache cache
uses: actions/cache/save@v3
with:
- name: Save ccache cache
uses: actions/cache/save@v3
with:
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
uses: ./.github/workflows/build.yml
with:
container_name: toolchain
uses: ./.github/workflows/build.yml
with:
container_name: toolchain
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
strategy:
fail-fast: False
matrix:
strategy:
fail-fast: False
matrix:
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
uses: ./.github/workflows/build.yml
with:
container_name: toolchain
uses: ./.github/workflows/build.yml
with:
container_name: toolchain
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
uses: ./.github/workflows/check-kernel-patches.yml
with:
target: ${{ needs.set_target.outputs.target }}
uses: ./.github/workflows/check-kernel-patches.yml
with:
target: ${{ needs.set_target.outputs.target }}
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
uses: ./.github/workflows/build.yml
with:
container_name: toolchain
uses: ./.github/workflows/build.yml
with:
container_name: toolchain
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
strategy:
fail-fast: False
matrix:
strategy:
fail-fast: False
matrix:
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
strategy:
fail-fast: False
matrix:
strategy:
fail-fast: False
matrix:
permissions:
contents: read
packages: read
permissions:
contents: read
packages: read
strategy:
fail-fast: False
matrix:
strategy:
fail-fast: False
matrix: