diff --git a/.gitea/workflows/build_dashboard.yaml b/.gitea/workflows/build_dashboard.yaml index cbd066f..b8e47bb 100644 --- a/.gitea/workflows/build_dashboard.yaml +++ b/.gitea/workflows/build_dashboard.yaml @@ -23,22 +23,34 @@ jobs: with: node-version: '24' + - name: Hash source files + id: hash-src + run: echo "hash=$(find apps/dashboard-ui -type f \( -name '*.vue' -o -name '*.ts' -o -name '*.js' -o -name '*.css' -o -name '*.json' -o -name '*.html' \) | sort | xargs sha256sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" + + - uses: actions/cache@v3 + id: cache-build + with: + path: apps/dashboard-ui/dist + key: build-dashboard-${{ steps.hash-src.outputs.hash }} + - name: Hash package-lock id: hash-npm run: echo "hash=$(sha256sum apps/dashboard-ui/package-lock.json | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - uses: actions/cache@v3 + id: cache-npm with: - path: | - ~/.npm + path: ~/.npm key: npm-dashboard-${{ steps.hash-npm.outputs.hash }} restore-keys: npm-dashboard- - name: Install + if: steps.cache-build.outputs.cache-hit != 'true' working-directory: apps/dashboard-ui run: npm ci || npm install - name: Build + if: steps.cache-build.outputs.cache-hit != 'true' working-directory: apps/dashboard-ui run: npm run build diff --git a/.gitea/workflows/build_device_agent.yaml b/.gitea/workflows/build_device_agent.yaml index 4b3d614..db95c10 100644 --- a/.gitea/workflows/build_device_agent.yaml +++ b/.gitea/workflows/build_device_agent.yaml @@ -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: | diff --git a/.gitea/workflows/build_server_core.yaml b/.gitea/workflows/build_server_core.yaml index aa150b1..86b2564 100644 --- a/.gitea/workflows/build_server_core.yaml +++ b/.gitea/workflows/build_server_core.yaml @@ -24,7 +24,22 @@ jobs: go-version: '1.26' cache: true + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + id: hash-src + with: + patterns: | + apps/server-core/**/*.go + apps/server-core/go.mod + apps/server-core/go.sum + + - uses: actions/cache@v3 + id: cache-build + with: + path: apps/server-core/bin + key: build-server-core-${{ steps.hash-src.outputs.hash }} + - name: Build + if: steps.cache-build.outputs.cache-hit != 'true' working-directory: apps/server-core run: go build -o bin/server-core .