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