Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9eeac0192d | |||
| de44771485 | |||
| 752f80ea96 | |||
| 08269c034b | |||
| 89fa8928dc | |||
| 6fccd2010c | |||
| 4296334275 | |||
| daa836e97d | |||
| f9a89b64be | |||
| 775d25cb59 | |||
| ef992cb9db | |||
| c3b8a3f1ce |
+13
-17
@@ -10,7 +10,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-go@v6
|
- uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: 'stable'
|
go-version: 'stable'
|
||||||
@@ -18,11 +18,10 @@ jobs:
|
|||||||
run: go test -race -coverprofile=coverage.txt ./...
|
run: go test -race -coverprofile=coverage.txt ./...
|
||||||
|
|
||||||
- name: Check coverage
|
- name: Check coverage
|
||||||
uses: vladopajic/go-test-coverage@v2
|
id: coverage
|
||||||
with:
|
run: |
|
||||||
config: ./.testcoverage.yml
|
go install github.com/vladopajic/go-test-coverage/v2@latest
|
||||||
|
go-test-coverage --config ./.testcoverage.yml --github-action-output
|
||||||
# Download baseline coverage from main branch (for PRs)
|
|
||||||
- name: Download baseline coverage
|
- name: Download baseline coverage
|
||||||
if: gitea.event_name == 'pull_request'
|
if: gitea.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
@@ -30,14 +29,12 @@ jobs:
|
|||||||
name: coverage-baseline
|
name: coverage-baseline
|
||||||
path: ./baseline
|
path: ./baseline
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
# Compare coverage against baseline (for PRs)
|
|
||||||
- name: Compare coverage
|
- name: Compare coverage
|
||||||
if: gitea.event_name == 'pull_request'
|
if: gitea.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
CURRENT=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
|
CURRENT="${{ steps.coverage.outputs.total-coverage }}"
|
||||||
if [ -f ./baseline/coverage.txt ]; then
|
if [ -f ./baseline/coverage.txt ]; then
|
||||||
BASE=$(go tool cover -func=./baseline/coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
|
BASE=$(cat ./baseline/coverage.txt)
|
||||||
echo "Base coverage: ${BASE}%"
|
echo "Base coverage: ${BASE}%"
|
||||||
echo "Current coverage: ${CURRENT}%"
|
echo "Current coverage: ${CURRENT}%"
|
||||||
if [ "$(echo "$CURRENT < $BASE" | bc -l)" -eq 1 ]; then
|
if [ "$(echo "$CURRENT < $BASE" | bc -l)" -eq 1 ]; then
|
||||||
@@ -49,8 +46,9 @@ jobs:
|
|||||||
echo "No baseline coverage found, skipping comparison"
|
echo "No baseline coverage found, skipping comparison"
|
||||||
echo "Current coverage: ${CURRENT}%"
|
echo "Current coverage: ${CURRENT}%"
|
||||||
fi
|
fi
|
||||||
|
- name: Save coverage baseline
|
||||||
# Upload coverage as baseline (only on main)
|
if: gitea.ref == 'refs/heads/main'
|
||||||
|
run: echo "${{ steps.coverage.outputs.total-coverage }}" > coverage.txt
|
||||||
- name: Upload coverage baseline
|
- name: Upload coverage baseline
|
||||||
if: gitea.ref == 'refs/heads/main'
|
if: gitea.ref == 'refs/heads/main'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@@ -58,24 +56,22 @@ jobs:
|
|||||||
name: coverage-baseline
|
name: coverage-baseline
|
||||||
path: coverage.txt
|
path: coverage.txt
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
||||||
# Post coverage to PR comment
|
|
||||||
- name: Post coverage comment
|
- name: Post coverage comment
|
||||||
if: gitea.event_name == 'pull_request'
|
if: gitea.event_name == 'pull_request'
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
GITEA_URL: ${{ gitea.server_url }}
|
GITEA_URL: ${{ gitea.server_url }}
|
||||||
run: |
|
run: |
|
||||||
COVERAGE=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}')
|
COVERAGE="${{ steps.coverage.outputs.total-coverage }}"
|
||||||
curl -X POST "${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.pull_request.number }}/comments" \
|
curl -X POST "${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.pull_request.number }}/comments" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"body\": \"## Coverage Report\n\nTotal coverage: **${COVERAGE}**\"}"
|
-d "{\"body\": \"## Coverage Report\n\nTotal coverage: **${COVERAGE}%**\"}"
|
||||||
|
|
||||||
vulnerabilities:
|
vulnerabilities:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-go@v6
|
- uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: 'stable'
|
go-version: 'stable'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SKIP: no-commit-to-branch
|
SKIP: no-commit-to-branch
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-go@v6
|
- uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: stable
|
go-version: stable
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ repos:
|
|||||||
- --allow-multiple-documents
|
- --allow-multiple-documents
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
||||||
rev: v9.24.0
|
rev: v9.26.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: commitlint
|
- id: commitlint
|
||||||
stages: [ commit-msg ]
|
stages: [ commit-msg ]
|
||||||
@@ -30,10 +30,10 @@ repos:
|
|||||||
- id: go-test
|
- id: go-test
|
||||||
- id: gofumpt
|
- id: gofumpt
|
||||||
- repo: https://github.com/golangci/golangci-lint
|
- repo: https://github.com/golangci/golangci-lint
|
||||||
rev: v2.11.3
|
rev: v2.12.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: golangci-lint-full
|
- id: golangci-lint-full
|
||||||
- repo: https://github.com/gitleaks/gitleaks
|
- repo: https://github.com/gitleaks/gitleaks
|
||||||
rev: v8.30.0
|
rev: v8.30.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: gitleaks
|
- id: gitleaks
|
||||||
|
|||||||
@@ -2,6 +2,24 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [0.5.1] - 2026-06-27
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- *(ci)* Use go-test-coverage binary directly to fix Gitea Actions (#303)
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.30.1 (#296)
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.4 (#298)
|
||||||
|
- *(deps)* Update dependency go to v1.26.2 (#300)
|
||||||
|
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.25.0 (#304)
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.0 (#306)
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.1 (#308)
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.2 (#309)
|
||||||
|
- *(deps)* Update actions/checkout action to v7 (#311)
|
||||||
|
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.26.0 (#313)
|
||||||
|
|
||||||
## [0.5.0] - 2026-03-12
|
## [0.5.0] - 2026-03-12
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
|
|||||||
Reference in New Issue
Block a user