- moved git actions to gitea actions
- removed sonarqube - added report for junit tests
This commit is contained in:
+42
-7
@@ -19,16 +19,17 @@ runs:
|
||||
cp "$f" "junit-short/${short}"
|
||||
done
|
||||
|
||||
- name: Generate Markdown Report
|
||||
- name: Generate Markdown Test Report
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p reports
|
||||
python3 - <<'EOF'
|
||||
import glob, xml.etree.ElementTree as ET
|
||||
|
||||
# --- JUnit ---
|
||||
files = glob.glob("junit-short/*.xml")
|
||||
total_tests = total_failures = total_errors = total_skipped = 0
|
||||
rows = []
|
||||
test_rows = []
|
||||
|
||||
for f in sorted(files):
|
||||
tree = ET.parse(f)
|
||||
@@ -46,28 +47,62 @@ runs:
|
||||
total_failures += failures
|
||||
total_errors += errors
|
||||
total_skipped += skipped
|
||||
rows.append(f"| {status} | {name} | {tests} | {passed} | {failures + errors} | {skipped} |")
|
||||
test_rows.append(f"| {status} | {name} | {tests} | {passed} | {failures + errors} | {skipped} |")
|
||||
|
||||
total_passed = total_tests - total_failures - total_errors - total_skipped
|
||||
overall = "✅ All tests passed" if (total_failures + total_errors) == 0 else "❌ Some tests failed"
|
||||
|
||||
# --- JaCoCo ---
|
||||
def counter(el, type_):
|
||||
c = next((x for x in el.findall("counter") if x.get("type") == type_), None)
|
||||
if c is None:
|
||||
return 0, 0
|
||||
covered = int(c.get("covered", 0))
|
||||
missed = int(c.get("missed", 0))
|
||||
return covered, covered + missed
|
||||
|
||||
cov_rows = []
|
||||
jacoco_files = glob.glob("**/target/site/jacoco/jacoco.xml", recursive=True)
|
||||
|
||||
for jf in sorted(jacoco_files):
|
||||
tree = ET.parse(jf)
|
||||
root = tree.getroot()
|
||||
for pkg in root.findall("package"):
|
||||
name = pkg.get("name", "").replace("/", ".")
|
||||
line_cov, line_total = counter(pkg, "LINE")
|
||||
branch_cov, branch_total = counter(pkg, "BRANCH")
|
||||
line_pct = f"{100 * line_cov / line_total:.0f}%" if line_total else "n/a"
|
||||
branch_pct = f"{100 * branch_cov / branch_total:.0f}%" if branch_total else "n/a"
|
||||
cov_rows.append(f"| {name} | {line_pct} ({line_cov}/{line_total}) | {branch_pct} ({branch_cov}/{branch_total}) |")
|
||||
|
||||
# --- Markdown zusammenbauen ---
|
||||
md = (
|
||||
"# Test Report\n\n"
|
||||
f"**{overall}**\n\n"
|
||||
"## Test Results\n\n"
|
||||
"| | Tests | Passed | Failed | Skipped |\n"
|
||||
"|---|---|---|---|---|\n"
|
||||
f"| **Total** | {total_tests} | {total_passed} | {total_failures + total_errors} | {total_skipped} |\n\n"
|
||||
"## Details\n\n"
|
||||
"### Details\n\n"
|
||||
"| Status | Suite | Tests | Passed | Failed | Skipped |\n"
|
||||
"|---|---|---|---|---|---|\n"
|
||||
) + "\n".join(rows) + "\n"
|
||||
) + "\n".join(test_rows) + "\n\n"
|
||||
|
||||
with open("reports/index.md", "w") as out:
|
||||
if cov_rows:
|
||||
md += (
|
||||
"## Coverage\n\n"
|
||||
"| Package | Line Coverage | Branch Coverage |\n"
|
||||
"|---|---|---|\n"
|
||||
) + "\n".join(cov_rows) + "\n"
|
||||
else:
|
||||
md += "_No JaCoCo report found._\n"
|
||||
|
||||
with open("reports/test.md", "w") as out:
|
||||
out.write(md)
|
||||
print(md)
|
||||
EOF
|
||||
|
||||
- name: Commit Report to Repo
|
||||
- name: Commit Test-Report to Repo
|
||||
shell: bash
|
||||
env:
|
||||
GIT_USER: gitea-actions-bot
|
||||
@@ -17,19 +17,18 @@ jobs:
|
||||
build-and-analyse:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
|
||||
- name: Setup Java and Maven
|
||||
uses: ./.github/actions/setup-java-maven
|
||||
uses: ./.gitea/actions/setup-java-maven
|
||||
|
||||
- name: Build and test
|
||||
run: mvn -B verify
|
||||
|
||||
- name: Publish Test Report
|
||||
uses: ./.github/actions/publish-report/
|
||||
uses: ./.gitea/actions/publish-report
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
report-name: Summary of JUnit Tests
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
when:
|
||||
- event: push
|
||||
branch: develop
|
||||
|
||||
steps:
|
||||
# - name: hello
|
||||
# image: alpine
|
||||
# commands:
|
||||
# - echo "Hello World!"
|
||||
|
||||
- name: maven verify
|
||||
image: maven:3-amazoncorretto-17-alpine
|
||||
commands:
|
||||
- mvn -B verify
|
||||
@@ -22,35 +22,7 @@ The project has its own maven repository. Follow the instructions on the latest
|
||||
|
||||
## Changelog
|
||||
|
||||
- 0.4.0:
|
||||
- fixed some paging issues
|
||||
- **Breaking Change**: renamed `client.zone().record()` to `client.zone().getRecord()`
|
||||
- Code quality improvements: Increasing test coverage
|
||||
- 0.3.0:
|
||||
- **Breaking Change**:
|
||||
- **New Fluent API**: Changed the initialization of the client(`new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build()`)
|
||||
- Authentication with API token.
|
||||
- 0.2.0:
|
||||
- **Breaking Change**: `emptyResultThrowsException` default changed from `true` to `false`. Now applies to both
|
||||
single and multiple result requests. Empty results will be returned by default without throwing exceptions.
|
||||
- API method names refactored for consistency: `zoneListAll` → `zoneList`, `zoneInfo` → `zoneGet`, `sldListAll` →
|
||||
`recordList`
|
||||
- RecordEntity getter methods renamed for clarity: `getName()` → `getSld()`
|
||||
- **New Fluent API**: Changed the initialization of the client(`new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build()`) and added chainable method interface for more readable DNS operations (
|
||||
`client.zone().record()...`)
|
||||
- Code quality improvements: removed duplication in batch operations, improved type safety in HTTP methods,
|
||||
optimized string concatenation, removed mutable setters from CfDnsClient
|
||||
- Enhanced type validation in `RecordEntity.build()` with better error messages
|
||||
- CfClient#recordList must return multiple RecordEntries
|
||||
- add a missing source jar
|
||||
- ResponseResultInfo#Errors: wrong object structure
|
||||
- changing multiple records with put, post, patch and delete for dns-records
|
||||
- 0.1.0:
|
||||
- refactored / extended tests
|
||||
- 0.1.0-beta.3:
|
||||
- fixed json deserialization
|
||||
- added logging of api errors
|
||||
- 0.1.0-beta.1: 1st runnable version
|
||||
See [changelog](changelog.md)
|
||||
|
||||
## Methods Overview
|
||||
|
||||
@@ -439,6 +411,3 @@ try {
|
||||
|
||||
---
|
||||
|
||||
# Summary
|
||||
|
||||
`CfDnsClient` offers a simple interface for managing DNS entries via Cloudflare's public API, allowing seamless CRUD operations and automation-friendly workflows.
|
||||
@@ -0,0 +1,34 @@
|
||||
# Changelog
|
||||
|
||||
- 0.5.0-SNAPSHOT:
|
||||
- moved the project to git.mein-gateway.de
|
||||
- replaced sonarqube with own actions
|
||||
- 0.4.0:
|
||||
- fixed some paging issues
|
||||
- **Breaking Change**: renamed `client.zone().record()` to `client.zone().getRecord()`
|
||||
- Code quality improvements: Increasing test coverage
|
||||
- 0.3.0:
|
||||
- **Breaking Change**:
|
||||
- **New Fluent API**: Changed the initialization of the client(`new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build()`)
|
||||
- Authentication with API token.
|
||||
- 0.2.0:
|
||||
- **Breaking Change**: `emptyResultThrowsException` default changed from `true` to `false`. Now applies to both
|
||||
single and multiple result requests. Empty results will be returned by default without throwing exceptions.
|
||||
- API method names refactored for consistency: `zoneListAll` → `zoneList`, `zoneInfo` → `zoneGet`, `sldListAll` →
|
||||
`recordList`
|
||||
- RecordEntity getter methods renamed for clarity: `getName()` → `getSld()`
|
||||
- **New Fluent API**: Changed the initialization of the client(`new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build()`) and added chainable method interface for more readable DNS operations (
|
||||
`client.zone().record()...`)
|
||||
- Code quality improvements: removed duplication in batch operations, improved type safety in HTTP methods,
|
||||
optimized string concatenation, removed mutable setters from CfDnsClient
|
||||
- Enhanced type validation in `RecordEntity.build()` with better error messages
|
||||
- CfClient#recordList must return multiple RecordEntries
|
||||
- add a missing source jar
|
||||
- ResponseResultInfo#Errors: wrong object structure
|
||||
- changing multiple records with put, post, patch and delete for dns-records
|
||||
- 0.1.0:
|
||||
- refactored / extended tests
|
||||
- 0.1.0-beta.3:
|
||||
- fixed json deserialization
|
||||
- added logging of api errors
|
||||
- 0.1.0-beta.1: 1st runnable version
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
@@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Cloudflare DNS Client - java</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Cloudflare DNS Client - java</h1>
|
||||
<p>A Java-based client for interacting with the Cloudflare DNS API.</p>
|
||||
<p>
|
||||
<a href="apidocs/index.html" target="_blank">View API Documentation</a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
**✅ All tests passed**
|
||||
|
||||
## Test Results
|
||||
|
||||
| | Tests | Passed | Failed | Skipped |
|
||||
|---|---|---|---|---|
|
||||
| **Total** | 90 | 90 | 0 | 0 |
|
||||
|
||||
## Details
|
||||
### Details
|
||||
|
||||
| Status | Suite | Tests | Passed | Failed | Skipped |
|
||||
|---|---|---|---|---|---|
|
||||
@@ -24,3 +26,11 @@
|
||||
| ✅ | codes.thischwa.cf.model.RecordEntityTest | 6 | 6 | 0 | 0 |
|
||||
| ✅ | codes.thischwa.cf.model.RecordTypeTest | 3 | 3 | 0 | 0 |
|
||||
| ✅ | codes.thischwa.cf.model.ZoneEntityTest | 1 | 1 | 0 | 0 |
|
||||
|
||||
## Coverage
|
||||
|
||||
| Package | Line Coverage | Branch Coverage |
|
||||
|---|---|---|
|
||||
| codes.thischwa.cf.fluent | 100% (25/25) | 100% (4/4) |
|
||||
| codes.thischwa.cf.model | 100% (93/93) | 90% (9/10) |
|
||||
| codes.thischwa.cf | 89% (249/279) | 71% (51/72) |
|
||||
Reference in New Issue
Block a user