Files
Nexus-Guard-Suite/.gitea/workflows/ci.yml
T
datadunia 5fb815a3c1
CI / dashboard-test (push) Successful in 1m24s
CI / build-server-core (push) Has been skipped
CI / build-device-agent (push) Has been skipped
CI / build-dashboard (push) Has been skipped
CI / build-docs (push) Has been skipped
CI / release (push) Has been skipped
CI / server-core-test (push) Failing after 4m31s
CI / device-agent-test (push) Successful in 1m22s
fix(ci): move token+persist-credentials to test job checkout, insteadOf after checkout
Test jobs failed because actions/checkout@v4 erases global insteadOf
during 'Setting up auth for fetching submodules', replacing it with
SSH mappings that don't help with x-access-token auth.

Fix: Add token + persist-credentials to checkout (same pattern as
reusable build workflows that pass), and move insteadOf after checkout
as a safety net for subsequent git operations.
2026-06-17 10:56:27 +07:00

111 lines
3.5 KiB
YAML

name: CI
on:
push:
tags:
- 'dev-*'
- 'v*-dev*'
- 'v*-beta*'
- 'v*-test*'
- 'v[0-9]*.[0-9]*.[0-9]'
jobs:
# --- TESTS (only for test tags) ---
server-core-test:
if: contains(gitea.ref_name, 'test')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.BUILD_TOKEN }}
persist-credentials: true
- 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/setup-go@v5
with:
go-version: '1.26'
- 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: Test (skip nftables - needs root)
working-directory: apps/server-core
run: go test $(go list ./... | grep -v internal/firewall) -tags dev -cover -count=1
device-agent-test:
if: contains(gitea.ref_name, 'test')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.BUILD_TOKEN }}
persist-credentials: true
- 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/setup-go@v5
with:
go-version: '1.26'
- name: Test
working-directory: apps/device-agent
run: go test ./... -cover
dashboard-test:
if: contains(gitea.ref_name, 'test')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.BUILD_TOKEN }}
persist-credentials: true
- 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/setup-node@v4
with:
node-version: '24'
- name: Install
working-directory: apps/dashboard-ui
run: npm ci || npm install
- name: Build
working-directory: apps/dashboard-ui
run: npm run build
# --- BUILD + RELEASE (only for dev/beta/release tags, no tests needed) ---
build-server-core:
if: "!contains(gitea.ref_name, 'test')"
runs-on: ubuntu-latest
uses: ./.gitea/workflows/build_server_core.yaml
secrets: inherit
build-device-agent:
if: "!contains(gitea.ref_name, 'test')"
runs-on: ubuntu-latest
uses: ./.gitea/workflows/build_device_agent.yaml
secrets: inherit
build-dashboard:
if: "!contains(gitea.ref_name, 'test')"
runs-on: ubuntu-latest
uses: ./.gitea/workflows/build_dashboard.yaml
secrets: inherit
build-docs:
if: "!contains(gitea.ref_name, 'test')"
runs-on: ubuntu-latest
uses: ./.gitea/workflows/docs_call.yaml
secrets: inherit
release:
if: "!contains(gitea.ref_name, 'test')"
needs: [build-server-core, build-device-agent, build-dashboard, build-docs]
uses: ./.gitea/workflows/release_call.yaml
with:
prerelease: ${{ contains(gitea.ref_name, 'dev-') || contains(gitea.ref_name, 'beta') }}
secrets: inherit