76 lines
2.0 KiB
Plaintext
76 lines
2.0 KiB
Plaintext
# Backup of .gitea/workflows/ci.yml — created before adding integration-verify-locks job
|
|
# timestamp: 2026-01-23
|
|
|
|
# CI/CD Pipeline for dbbackup (backup copy)
|
|
# Source: .gitea/workflows/ci.yml
|
|
# Created: 2026-01-23
|
|
|
|
name: CI/CD
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master, develop]
|
|
tags: ['v*']
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: golang:1.24-bookworm
|
|
steps:
|
|
- name: Checkout code
|
|
env:
|
|
TOKEN: ${{ github.token }}
|
|
run: |
|
|
apt-get update && apt-get install -y -qq git ca-certificates
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
git init
|
|
git remote add origin "https://${TOKEN}@git.uuxo.net/${GITHUB_REPOSITORY}.git"
|
|
git fetch --depth=1 origin "${GITHUB_SHA}"
|
|
git checkout FETCH_HEAD
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Run tests
|
|
run: go test -race -coverprofile=coverage.out ./...
|
|
|
|
- name: Coverage summary
|
|
run: go tool cover -func=coverage.out | tail -1
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: golang:1.24-bookworm
|
|
steps:
|
|
- name: Checkout code
|
|
env:
|
|
TOKEN: ${{ github.token }}
|
|
run: |
|
|
apt-get update && apt-get install -y -qq git ca-certificates
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
git init
|
|
git remote add origin "https://${TOKEN}@git.uuxo.net/${GITHUB_REPOSITORY}.git"
|
|
git fetch --depth=1 origin "${GITHUB_SHA}"
|
|
git checkout FETCH_HEAD
|
|
|
|
- name: Install and run golangci-lint
|
|
run: |
|
|
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0
|
|
golangci-lint run --timeout=5m ./...
|
|
|
|
build-and-release:
|
|
name: Build & Release
|
|
runs-on: ubuntu-latest
|
|
needs: [test, lint]
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
container:
|
|
image: golang:1.24-bookworm
|
|
steps: |
|
|
<trimmed for backup>
|
|
|