Refactor project structure: modularized code into pkg and cmd directories, added unit tests, improved CI/CD pipeline, and enhanced documentation.

This commit is contained in:
2026-02-23 17:17:01 +01:00
parent 2077d4132b
commit 9432bf6758
9 changed files with 260 additions and 25 deletions

28
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,28 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Run tests with coverage
run: |
go test -v -coverprofile=coverage.out ./...
go tool cover -func=coverage.out | tee coverage.txt
cov=$(go tool cover -func=coverage.out | grep total: | awk '{print substr($3, 1, length($3)-1)}')
cov=${cov%.*}
if [ "$cov" -lt 80 ]; then
echo "::warning::Test coverage is below 80% ($cov%)"
fi
- name: Build Docker image
run: docker build -t diun-webhook-dashboard .