ci: speed up pipelines — ccache with cross-run cache, shallow CI checkout
linux / build (push) Canceled after 26s

This commit is contained in:
2026-11-29 16:36:23 +00:00
parent a14fc32632
commit ca6db365c5
2 changed files with 40 additions and 6 deletions
+23 -5
View File
@@ -13,6 +13,11 @@ concurrency:
group: ${{ gitea.workflow }}-${{ gitea.ref }}
cancel-in-progress: true
env:
# Jobs run as root in the pinned container; keep this stable so the
# actions/cache path below matches.
CCACHE_DIR: /root/.cache/ccache
jobs:
build:
runs-on: ubuntu-latest
@@ -24,14 +29,14 @@ jobs:
options: --user root
steps:
# Recursive submodules are required: vendor/librw, vendor/ogg, vendor/opus and
# vendor/opusfile are git submodules. fetch-depth: 0 is kept as a safe default;
# get_git_head_revision() only reads .git/HEAD and the ref, so full history is
# not strictly needed, but a full clone avoids shallow-clone edge cases.
# vendor/opusfile are git submodules. get_git_head_revision() only reads
# .git/HEAD + the ref, so a shallow clone (fetch-depth: 1) is sufficient for CI;
# the release workflow keeps full history for its changelog.
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-depth: 1
# act_runner images run as root without sudo; install directly.
- name: Install build deps
@@ -43,12 +48,23 @@ jobs:
ninja-build \
pkg-config \
file \
ccache \
libglfw3-dev \
libopenal-dev \
libsndfile1-dev \
libmpg123-dev \
libgl-dev
# Persist the compiler cache across runs; restore-keys falls back to the most
# recent cache for this platform when the exact ref key misses.
- name: Restore ccache
uses: actions/cache@v4
with:
path: /root/.cache/ccache
key: ccache-linux-x64-${{ gitea.ref }}
restore-keys: |
ccache-linux-x64-
# GL3 renderer via vendored librw + OpenAL audio = the documented Linux configuration.
- name: Configure
run: |
@@ -57,7 +73,9 @@ jobs:
-DREVC_AUDIO=OAL \
-DREVC_VENDORED_LIBRW=True \
-DLIBRW_PLATFORM=GL3 \
-DLIBRW_GL3_GFXLIB=GLFW
-DLIBRW_GL3_GFXLIB=GLFW \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
# No -Werror: this legacy codebase warns, and warnings must not fail the build.
- name: Build
+17 -1
View File
@@ -27,6 +27,9 @@ env:
# The runner injects the job token via the SECRETS context (secrets.GITEA_TOKEN /
# secrets.GITHUB_TOKEN), not as plain env vars — materialise it here once.
API_TOKEN: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN }}
# Jobs run as root in the pinned container; keep this stable so the
# actions/cache path below matches.
CCACHE_DIR: /root/.cache/ccache
jobs:
release:
@@ -59,6 +62,7 @@ jobs:
ninja-build \
pkg-config \
file \
ccache \
zip \
python3 \
libglfw3-dev \
@@ -132,6 +136,16 @@ jobs:
# Workspace is disposable: force-fetch the tag so the checkout has it.
git fetch --force origin "refs/tags/$TAG:refs/tags/$TAG"
# Persist the compiler cache across runs; restore-keys falls back to the most
# recent cache for this platform when the exact ref key misses.
- name: Restore ccache
uses: actions/cache@v4
with:
path: /root/.cache/ccache
key: ccache-linux-x64-${{ gitea.ref }}
restore-keys: |
ccache-linux-x64-
# GL3 renderer via vendored librw + OpenAL audio = the documented Linux configuration.
- name: Configure
run: |
@@ -140,7 +154,9 @@ jobs:
-DREVC_AUDIO=OAL \
-DREVC_VENDORED_LIBRW=True \
-DLIBRW_PLATFORM=GL3 \
-DLIBRW_GL3_GFXLIB=GLFW
-DLIBRW_GL3_GFXLIB=GLFW \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
# No -Werror: this legacy codebase warns, and warnings must not fail the build.
- name: Build