Files
Nexus-Guard-Suite/.gitea/workflows/ci.yml
T

111 lines
3.3 KiB
YAML

name: CI
on:
push:
tags:
- 'dev-*'
- 'v*-beta*'
- 'v*-test*'
- 'v[0-9]*.[0-9]*.[0-9]'
jobs:
server-core-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/server-core
steps:
- name: Rewrite submodule URLs
run: |
git config --global url."http://172.20.8.90:3000/".insteadOf "https://git.datadunia.com/"
git config --global url."http://172.20.8.90:3000/".insteadOf "http://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'
- name: Test
run: go test ./... -tags dev -cover
device-agent-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/device-agent
steps:
- name: Rewrite submodule URLs
run: |
git config --global url."http://172.20.8.90:3000/".insteadOf "https://git.datadunia.com/"
git config --global url."http://172.20.8.90:3000/".insteadOf "http://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'
- name: Test
run: go test ./... -cover
dashboard-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/dashboard-ui
steps:
- name: Rewrite submodule URLs
run: |
git config --global url."http://172.20.8.90:3000/".insteadOf "https://git.datadunia.com/"
git config --global url."http://172.20.8.90:3000/".insteadOf "http://git.datadunia.com/"
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.BUILD_TOKEN }}
persist-credentials: true
- uses: actions/setup-node@v4
with:
node-version: '24'
- name: Install
run: npm ci || npm install
- name: Build
run: npm run build
build-server-core:
if: "!contains(gitea.ref_name, 'test')"
needs: [server-core-test, device-agent-test, dashboard-test]
runs-on: ubuntu-latest
uses: ./.gitea/workflows/build_server_core.yaml
build-device-agent:
if: "!contains(gitea.ref_name, 'test')"
needs: [server-core-test, device-agent-test, dashboard-test]
runs-on: ubuntu-latest
uses: ./.gitea/workflows/build_device_agent.yaml
build-dashboard:
if: "!contains(gitea.ref_name, 'test')"
needs: [server-core-test, device-agent-test, dashboard-test]
runs-on: ubuntu-latest
uses: ./.gitea/workflows/build_dashboard.yaml
build-docs:
if: "!contains(gitea.ref_name, 'test')"
needs: [server-core-test, device-agent-test, dashboard-test]
runs-on: ubuntu-latest
uses: ./.gitea/workflows/docs_call.yaml
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