From d8dfad2b32cda9b3f90be3dce75480991d3c2be5 Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Sun, 5 Jul 2026 20:37:59 +0100 Subject: [PATCH] ci: add Go and npm dependency caching via actions/cache Add actions/cache@v4 to all four CI jobs. Go module cache (go/pkg/mod + go-build) keyed on go.sum for test, race, and vulns jobs. npm cache (~/.npm + node_modules) keyed on package-lock.json for frontend job. Cuts dependency download time to near-zero on cache hit. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- .gitea/workflows/ci.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 7299ac6..b858da1 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -40,6 +40,16 @@ jobs: go-version: "1.25" cache: false + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('backend/go.sum') }}-test + restore-keys: | + ${{ runner.os }}-go- + - name: Fix node toolcache path for Post-step cleanup run: | mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin @@ -95,6 +105,16 @@ jobs: go-version: "1.25" cache: false + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('backend/go.sum') }}-race + restore-keys: | + ${{ runner.os }}-go- + - name: Fix node toolcache path for Post-step cleanup run: | mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin @@ -132,6 +152,16 @@ jobs: go-version: "1.25" cache: false + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('backend/go.sum') }}-vulns + restore-keys: | + ${{ runner.os }}-go- + - name: Fix node toolcache path for Post-step cleanup run: | mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin @@ -157,6 +187,16 @@ jobs: mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin ln -sf /usr/local/bin/node /opt/hostedtoolcache/node/22.23.1/x64/bin/node + - name: Cache npm dependencies + uses: actions/cache@v4 + with: + path: | + ~/.npm + frontend/node_modules + key: ${{ runner.os }}-npm-${{ hashFiles('frontend/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + - name: Frontend type check run: | cd frontend