ci: add Go and npm dependency caching via actions/cache
CI / Go vulnerabilities (push) Successful in 58s
CI / Tests (push) Successful in 1m53s
CI / Frontend lint & types (push) Successful in 2m12s
CI / Race detector (push) Successful in 3m59s

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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-07-05 20:37:59 +01:00
co-authored by Sisyphus
parent 1c1fc6a921
commit d8dfad2b32
+40
View File
@@ -40,6 +40,16 @@ jobs:
go-version: "1.25" go-version: "1.25"
cache: false 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 - name: Fix node toolcache path for Post-step cleanup
run: | run: |
mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin
@@ -95,6 +105,16 @@ jobs:
go-version: "1.25" go-version: "1.25"
cache: false 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 - name: Fix node toolcache path for Post-step cleanup
run: | run: |
mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin
@@ -132,6 +152,16 @@ jobs:
go-version: "1.25" go-version: "1.25"
cache: false 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 - name: Fix node toolcache path for Post-step cleanup
run: | run: |
mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin 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 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 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 - name: Frontend type check
run: | run: |
cd frontend cd frontend