From 241d6ca34c60d9003a27bb7960cebfb66366753b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 21 Aug 2023 11:26:11 +0100 Subject: ci: Disable cache save for pull requests in GitHub Actions Otherwise, multiple pull requests fill GitHub Actions cache quota shortly. --- .github/workflows/ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5695d01cc..87668cd662 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,12 +51,20 @@ jobs: - name: Set Ccache directory run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV" - - name: Ccache cache - uses: actions/cache@v3 + - name: Restore Ccache cache + uses: actions/cache/restore@v3 with: path: ${{ env.CCACHE_DIR }} - key: ${{ github.job }}-ccache-cache-${{ github.run_id }} - restore-keys: ${{ github.job }}-ccache-cache + key: ${{ github.job }}-ccache-${{ github.run_id }} + restore-keys: ${{ github.job }}-ccache- - name: CI script run: ./ci/test_run_all.sh + + - name: Save Ccache cache + uses: actions/cache/save@v3 + if: github.event_name != 'pull_request' + with: + path: ${{ env.CCACHE_DIR }} + # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache + key: ${{ github.job }}-ccache-${{ github.run_id }} -- cgit v1.2.3