mirror of
https://github.com/openwrt/openwrt.git
synced 2024-11-27 03:43:37 +08:00
CI: build: add job to remove previous ccache cache if already exist
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>
This commit is contained in:
parent
6321361c6b
commit
203cc0a7ef
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@ -136,6 +136,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
|
||||
steps:
|
||||
- name: Checkout master directory
|
||||
@ -475,6 +476,16 @@ jobs:
|
||||
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:
|
||||
|
1
.github/workflows/coverity.yml
vendored
1
.github/workflows/coverity.yml
vendored
@ -15,6 +15,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
|
1
.github/workflows/kernel.yml
vendored
1
.github/workflows/kernel.yml
vendored
@ -105,6 +105,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
|
2
.github/workflows/label-kernel.yml
vendored
2
.github/workflows/label-kernel.yml
vendored
@ -30,6 +30,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
@ -44,6 +45,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: ./.github/workflows/check-kernel-patches.yml
|
||||
with:
|
||||
target: ${{ needs.set_target.outputs.target }}
|
||||
|
1
.github/workflows/label-target.yml
vendored
1
.github/workflows/label-target.yml
vendored
@ -30,6 +30,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
|
1
.github/workflows/packages.yml
vendored
1
.github/workflows/packages.yml
vendored
@ -35,6 +35,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
|
1
.github/workflows/push-containers.yml
vendored
1
.github/workflows/push-containers.yml
vendored
@ -153,6 +153,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
|
1
.github/workflows/toolchain.yml
vendored
1
.github/workflows/toolchain.yml
vendored
@ -61,6 +61,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
|
Loading…
Reference in New Issue
Block a user