feat(ci): skip build if no source changes (cache build output by hash)

This commit is contained in:
datadunia
2026-06-18 09:09:51 +07:00
parent 6f22aad1ad
commit 08b152a370
3 changed files with 45 additions and 2 deletions
+16
View File
@@ -24,13 +24,29 @@ jobs:
go-version: '1.26'
cache: true
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-src
with:
patterns: |
apps/device-agent/**/*.go
apps/device-agent/go.mod
apps/device-agent/go.sum
- uses: actions/cache@v3
id: cache-build
with:
path: apps/device-agent/bin
key: build-device-agent-${{ steps.hash-src.outputs.hash }}
- name: Generate Windows resources (UAC manifest + icon)
if: steps.cache-build.outputs.cache-hit != 'true'
working-directory: apps/device-agent
run: |
go install github.com/tc-hib/go-winres@latest
go-winres make
- name: Build all platforms
if: steps.cache-build.outputs.cache-hit != 'true'
working-directory: apps/device-agent
shell: bash
run: |