9 Commits

Author SHA1 Message Date
renovate 4a04370f50 chore(deps): update pre-commit hook golangci/golangci-lint to v2.10.1 (#72)
Release / release (push) Successful in 1m13s
dbsetup / vulnerabilities (push) Successful in 3m11s
dbsetup / test (push) Successful in 3m30s
pre-commit / pre-commit (push) Successful in 7m47s
2026-02-17 17:04:12 +00:00
renovate 761154be92 chore(deps): update pre-commit hook golangci/golangci-lint to v2.9.0 (#71)
dbsetup / vulnerabilities (push) Failing after 2s
dbsetup / test (push) Failing after 2s
pre-commit / pre-commit (push) Failing after 2s
Release / release (push) Successful in 39s
2026-02-11 10:35:33 +00:00
argoyle 87e9adac97 Merge pull request 'ci: add code coverage integration' (#69) from ci-coverage-integration into main
Release / release (push) Successful in 4m32s
dbsetup / vulnerabilities (push) Successful in 7m57s
dbsetup / test (push) Successful in 8m17s
pre-commit / pre-commit (push) Successful in 15m7s
Reviewed-on: #69
2026-01-28 12:38:13 +00:00
argoyle d0e92e767a ci: add code coverage integration
dbsetup / test (pull_request) Successful in 7m10s
dbsetup / vulnerabilities (pull_request) Successful in 6m34s
pre-commit / pre-commit (pull_request) Successful in 11m20s
Add go-test-coverage for coverage threshold enforcement. Coverage data
is uploaded as artifacts on main branch and compared against baseline
in PRs using shell script that gracefully handles first run without
baseline. PR comments show coverage percentage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:03:07 +01:00
argoyle 379a820a70 Merge pull request 'chore: remove unused .gitlab-ci.yml' (#68) from remove-gitlab-ci into main
Release / release (push) Successful in 3m43s
dbsetup / test (push) Successful in 5m50s
dbsetup / vulnerabilities (push) Successful in 7m15s
pre-commit / pre-commit (push) Successful in 14m52s
Reviewed-on: #68
2026-01-23 14:56:24 +00:00
argoyle 2025050f72 chore: remove unused .gitlab-ci.yml
dbsetup / vulnerabilities (pull_request) Successful in 3m52s
dbsetup / test (pull_request) Successful in 6m2s
pre-commit / pre-commit (pull_request) Successful in 6m17s
No longer needed after migration to Gitea Actions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 14:34:51 +01:00
renovate 2341ab5a10 chore(deps): update golang docker tag to v1.25.6 (#67)
dbsetup / test (push) Successful in 1m32s
Release / release (push) Successful in 2m53s
dbsetup / vulnerabilities (push) Successful in 3m54s
pre-commit / pre-commit (push) Successful in 8m5s
2026-01-15 22:25:51 +00:00
renovate f01cfc08af chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.24.0 (#65)
Release / release (push) Successful in 1m3s
dbsetup / vulnerabilities (push) Successful in 4m10s
dbsetup / test (push) Successful in 4m30s
pre-commit / pre-commit (push) Successful in 17m39s
2026-01-13 21:15:21 +00:00
renovate 082a672a34 chore(deps): update golang:1.25.5 docker digest to 3a01526 (#64)
Release / release (push) Failing after 51s
dbsetup / vulnerabilities (push) Successful in 1m3s
dbsetup / test (push) Successful in 1m27s
pre-commit / pre-commit (push) Successful in 15m34s
2026-01-13 06:14:33 +00:00
4 changed files with 70 additions and 40 deletions
+55
View File
@@ -17,6 +17,61 @@ jobs:
- name: Run tests
run: go test -race -coverprofile=coverage.txt ./...
- name: Check coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
# Download baseline coverage from main branch (for PRs)
- name: Download baseline coverage
if: gitea.event_name == 'pull_request'
uses: actions/download-artifact@v3
with:
name: coverage-baseline
path: ./baseline
continue-on-error: true
# Compare coverage against baseline (for PRs)
- name: Compare coverage
if: gitea.event_name == 'pull_request'
run: |
CURRENT=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
if [ -f ./baseline/coverage.txt ]; then
BASE=$(go tool cover -func=./baseline/coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
echo "Base coverage: ${BASE}%"
echo "Current coverage: ${CURRENT}%"
if [ "$(echo "$CURRENT < $BASE" | bc -l)" -eq 1 ]; then
echo "::error::Coverage decreased from ${BASE}% to ${CURRENT}%"
exit 1
fi
echo "Coverage maintained or improved: ${BASE}% -> ${CURRENT}%"
else
echo "No baseline coverage found, skipping comparison"
echo "Current coverage: ${CURRENT}%"
fi
# Upload coverage as baseline (only on main)
- name: Upload coverage baseline
if: gitea.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: coverage-baseline
path: coverage.txt
retention-days: 90
# Post coverage to PR comment
- name: Post coverage comment
if: gitea.event_name == 'pull_request'
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ gitea.server_url }}
run: |
COVERAGE=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}')
curl -X POST "${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.pull_request.number }}/comments" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"body\": \"## Coverage Report\n\nTotal coverage: **${COVERAGE}**\"}"
vulnerabilities:
runs-on: ubuntu-latest
steps:
-38
View File
@@ -1,38 +0,0 @@
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
- project: unboundsoftware/ci-templates
file: Defaults.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Release.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Pre-Commit-Go.gitlab-ci.yml
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
stages:
- deps
- test
deps:
stage: deps
script:
- go mod download
test:
stage: test
dependencies:
- deps
script:
- CGO_ENABLED=1 go test -mod=readonly -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
- go tool cover -html=coverage.txt -o coverage.html
- go tool cover -func=coverage.txt
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov -t ${CODECOV_TOKEN} -R $CI_PROJECT_DIR -C $CI_COMMIT_SHA -r $CI_PROJECT_PATH
vulnerabilities:
stage: test
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
script:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
+2 -2
View File
@@ -11,7 +11,7 @@ repos:
- --allow-multiple-documents
- id: check-added-large-files
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.23.0
rev: v9.24.0
hooks:
- id: commitlint
stages: [ commit-msg ]
@@ -30,7 +30,7 @@ repos:
- id: go-test
- id: gofumpt
- repo: https://github.com/golangci/golangci-lint
rev: v2.8.0
rev: v2.10.1
hooks:
- id: golangci-lint-full
- repo: https://github.com/gitleaks/gitleaks
+13
View File
@@ -0,0 +1,13 @@
# Coverage configuration for go-test-coverage
# https://github.com/vladopajic/go-test-coverage
profile: coverage.txt
threshold:
file: 0
package: 0
total: 0
exclude:
paths:
- _test\.go$