openwrt/.github/workflows/label-target.yml
Christian Marangi 203cc0a7ef
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>
2023-05-31 13:22:03 +02:00

43 lines
1.2 KiB
YAML

# ci:target:x86:64 is going to trigger CI target check jobs for x86/64 target
name: Build check target specified in labels
on:
pull_request:
types:
- labeled
jobs:
set_target:
if: startsWith(github.event.label.name, 'ci:target:')
name: Set target
runs-on: ubuntu-latest
outputs:
target: ${{ steps.set_target.outputs.target }}
subtarget: ${{ steps.set_target.outputs.subtarget }}
steps:
- name: Set target
id: set_target
env:
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
run: |
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT
build_target:
name: Build target
needs: set_target
permissions:
contents: read
packages: read
actions: write
uses: ./.github/workflows/build.yml
with:
container_name: toolchain
target: ${{ needs.set_target.outputs.target }}
subtarget: ${{ needs.set_target.outputs.subtarget }}
build_full: true
build_all_kmods: true
build_all_boards: true
build_all_modules: true