ci: don't save caches for pull requests

This commit is contained in:
tobtoht
2026-05-25 12:07:33 +02:00
parent 8fd42c3baf
commit 816cc806e9
3 changed files with 82 additions and 15 deletions
+55 -6
View File
@@ -40,7 +40,9 @@ jobs:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/cache@v5
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: /Users/runner/Library/Caches/ccache
key: ccache-${{ runner.os }}-build-${{ github.sha }}
@@ -57,6 +59,12 @@ jobs:
run: |
${{env.CCACHE_SETTINGS}}
${{env.BUILD_DEFAULT}}
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
build-windows:
name: 'Windows (MSYS2)'
@@ -68,7 +76,9 @@ jobs:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/cache@v5
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: C:\Users\runneradmin\AppData\Local\ccache
key: ccache-${{ runner.os }}-build-${{ github.sha }}
@@ -76,6 +86,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
update: true
cache: false
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound mingw-w64-x86_64-rust git pkg-config
- uses: ./.github/actions/set-make-job-count
- name: build
@@ -84,6 +95,12 @@ jobs:
run: |
${{env.CCACHE_SETTINGS}}
${{env.BUILD_DEFAULT}}
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: C:\Users\runneradmin\AppData\Local\ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
build-arch:
name: 'Arch Linux'
@@ -98,7 +115,9 @@ jobs:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/cache@v5
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: ~/.cache/ccache
key: ccache-arch-build-${{ github.sha }}
@@ -110,6 +129,12 @@ jobs:
run: |
${{ env.CCACHE_SETTINGS }}
${{ env.BUILD_DEFAULT }}
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: ~/.cache/ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
build-debian:
# Oldest supported Debian version
@@ -133,7 +158,9 @@ jobs:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/cache@v5
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: ~/.cache/ccache
key: ccache-debian-11-build-${{ github.sha }}
@@ -145,6 +172,12 @@ jobs:
run: |
${{ env.CCACHE_SETTINGS }}
${{ env.BUILD_DEFAULT }}
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: ~/.cache/ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
build-ubuntu:
name: ${{ matrix.name }}
@@ -174,7 +207,9 @@ jobs:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/cache@v5
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: ~/.cache/ccache
key: ccache-${{ matrix.container }}-build-${{ github.sha }}
@@ -186,6 +221,12 @@ jobs:
run: |
${{env.CCACHE_SETTINGS}}
${{env.BUILD_DEFAULT}}
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: ~/.cache/ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
test-ubuntu:
name: "${{ matrix.name }} (tests)"
@@ -221,7 +262,9 @@ jobs:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/cache@v5
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: ~/.cache/ccache
key: ccache-${{ matrix.container }}-build-${{ github.sha }}
@@ -238,6 +281,12 @@ jobs:
${{env.CCACHE_SETTINGS}}
${{env.BUILD_DEFAULT}}
cmake --build build --target test
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: ~/.cache/ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
source-archive:
name: "source archive"