Cache manager #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cache manager | |
on: | |
schedule: | |
- cron: "0 0 * * 0" # Runs every Sunday at 0:00 UTC | |
workflow_dispatch: | |
jobs: | |
clear-caches-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Init | |
uses: actions/checkout@v4 | |
- name: Clear GH caches | |
run: | | |
sudo apt-get install gh | |
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token | |
caches_list=$(gh cache list) | |
if [ -z "${caches_list}" ]; then | |
echo "No caches to delete" | |
else | |
echo ${caches_list} | |
gh cache delete --all | |
fi | |
- name: Clear Buildjet Build # ALL These steps are slow (3 min due bug on buildjet action) | |
uses: buildjet/cache-delete@v1 | |
with: | |
cache_key: "build-cache" | |
- name: Clear Buildjet Test | |
uses: buildjet/cache-delete@v1 | |
with: | |
cache_key: "test-cache" | |
- name: Clear Buildjet Format | |
uses: buildjet/cache-delete@v1 | |
with: | |
cache_key: "lint-format-cache" | |
build-job: | |
needs: [clear-caches-job] | |
uses: ./.github/workflows/CI-build.yml | |
with: | |
CACHING_MODE: "CACHE_SAVE" | |
test-job: | |
needs: [clear-caches-job] | |
uses: ./.github/workflows/CI-test.yml | |
with: | |
CACHING_MODE: "CACHE_SAVE" | |
coverage-job: | |
needs: [clear-caches-job] | |
uses: ./.github/workflows/CI-coverage.yml | |
with: | |
CACHING_MODE: "CACHE_SAVE" | |
lint-format-job: | |
needs: [clear-caches-job] | |
uses: ./.github/workflows/CI-lint-format.yml | |
with: | |
CACHING_MODE: "CACHE_SAVE" |