Files
Nexus-Guard-Suite/.gitea/workflows/build_server_core.yaml
T
datadunia 290af48007
CI / server-core-test (push) Has been skipped
CI / device-agent-test (push) Has been skipped
CI / dashboard-test (push) Has been skipped
CI / build-server-core (push) Successful in 15m18s
CI / build-device-agent (push) Successful in 5m51s
CI / build-docs (push) Successful in 1m13s
CI / build-dashboard (push) Failing after 1m38s
CI / release (push) Has been skipped
ci: add Gitea-compatible caching (RUNNER_TOOL_CACHE + actions/cache@v3 + go-hashfiles)
Per Gitea tutorial: add RUNNER_TOOL_CACHE=/toolcache env, use actions/cache@v3
(not v4), and go-hashfiles instead of hashFiles() which is unsupported.
2026-06-17 14:23:51 +07:00

60 lines
1.6 KiB
YAML

name: Build Server Core
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
env:
RUNNER_TOOL_CACHE: /toolcache
steps:
- name: Configure git auth for submodules
run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/"
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.BUILD_TOKEN }}
persist-credentials: true
- uses: actions/setup-go@v5
with:
go-version: '1.26'
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |
apps/server-core/go.mod
apps/server-core/go.sum
- uses: actions/cache@v3
with:
path: |
/root/go/pkg/mod
/root/.cache/go-build
key: go-server-core-${{ steps.hash-go.outputs.hash }}
restore-keys: go-server-core-
- name: Download Go modules
working-directory: apps/server-core
run: go mod download
- name: Generate Swagger docs
working-directory: apps/server-core
run: |
go install github.com/swaggo/swag/cmd/swag@v1.16.6
swag init -g main.go --parseDependency --parseInternal
- name: Build
working-directory: apps/server-core
run: go build -o bin/server-core .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: server-core-linux-amd64
path: apps/server-core/bin/server-core