Migrate GitHub Actions workflows and custom actions to Gitea, replacing .github directory with .gitea.
Build and Analyse / build-and-analyse (push) Successful in 43s

This commit is contained in:
2026-06-28 13:09:05 +02:00
parent 9919230a3b
commit d4fba87e13
6 changed files with 13 additions and 65 deletions
@@ -25,12 +25,12 @@ runs:
mkdir -p reports mkdir -p reports
python3 - <<'EOF' python3 - <<'EOF'
import glob, xml.etree.ElementTree as ET import glob, xml.etree.ElementTree as ET
# --- JUnit --- # --- JUnit ---
files = glob.glob("junit-short/*.xml") files = glob.glob("junit-short/*.xml")
total_tests = total_failures = total_errors = total_skipped = 0 total_tests = total_failures = total_errors = total_skipped = 0
test_rows = [] test_rows = []
for f in sorted(files): for f in sorted(files):
tree = ET.parse(f) tree = ET.parse(f)
r = tree.getroot() r = tree.getroot()
@@ -48,10 +48,10 @@ runs:
total_errors += errors total_errors += errors
total_skipped += skipped total_skipped += skipped
test_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 total_passed = total_tests - total_failures - total_errors - total_skipped
overall = "✅ All tests passed" if (total_failures + total_errors) == 0 else "❌ Some tests failed" overall = "✅ All tests passed" if (total_failures + total_errors) == 0 else "❌ Some tests failed"
# --- JaCoCo --- # --- JaCoCo ---
def counter(el, type_): def counter(el, type_):
c = next((x for x in el.findall("counter") if x.get("type") == type_), None) c = next((x for x in el.findall("counter") if x.get("type") == type_), None)
@@ -60,10 +60,10 @@ runs:
covered = int(c.get("covered", 0)) covered = int(c.get("covered", 0))
missed = int(c.get("missed", 0)) missed = int(c.get("missed", 0))
return covered, covered + missed return covered, covered + missed
cov_rows = [] cov_rows = []
jacoco_files = glob.glob("**/target/site/jacoco/jacoco.xml", recursive=True) jacoco_files = glob.glob("**/target/site/jacoco/jacoco.xml", recursive=True)
for jf in sorted(jacoco_files): for jf in sorted(jacoco_files):
tree = ET.parse(jf) tree = ET.parse(jf)
root = tree.getroot() root = tree.getroot()
@@ -74,7 +74,7 @@ runs:
line_pct = f"{100 * line_cov / line_total:.0f}%" if line_total else "n/a" 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" 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}) |") cov_rows.append(f"| {name} | {line_pct} ({line_cov}/{line_total}) | {branch_pct} ({branch_cov}/{branch_total}) |")
# --- Markdown zusammenbauen --- # --- Markdown zusammenbauen ---
md = ( md = (
"# Test Report\n\n" "# Test Report\n\n"
@@ -87,7 +87,7 @@ runs:
"| Status | Suite | Tests | Passed | Failed | Skipped |\n" "| Status | Suite | Tests | Passed | Failed | Skipped |\n"
"|---|---|---|---|---|---|\n" "|---|---|---|---|---|---|\n"
) + "\n".join(test_rows) + "\n\n" ) + "\n".join(test_rows) + "\n\n"
if cov_rows: if cov_rows:
md += ( md += (
"## Coverage\n\n" "## Coverage\n\n"
@@ -96,7 +96,7 @@ runs:
) + "\n".join(cov_rows) + "\n" ) + "\n".join(cov_rows) + "\n"
else: else:
md += "_No JaCoCo report found._\n" md += "_No JaCoCo report found._\n"
with open("reports/test.md", "w") as out: with open("reports/test.md", "w") as out:
out.write(md) out.write(md)
print(md) print(md)
@@ -117,4 +117,4 @@ runs:
git add reports/ git add reports/
git diff --cached --quiet && echo "No changes" && exit 0 git diff --cached --quiet && echo "No changes" && exit 0
git commit -m "ci: update test report [skip ci]" git commit -m "ci: update test report [skip ci]"
git push origin ${{ github.ref_name }} git push origin ${{ github.ref_name }}
@@ -17,19 +17,18 @@ jobs:
build-and-analyse: build-and-analyse:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v7
with: with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Java and Maven - name: Setup Java and Maven
uses: ./.github/actions/setup-java-maven uses: ./.gitea/actions/setup-java-maven
- name: Build and test - name: Build and test
run: mvn -B verify run: mvn -B verify
- name: Publish Test Report - name: Publish Test Report
uses: ./.github/actions/publish-report/ uses: ./.gitea/actions/publish-report
if: ${{ always() }} if: ${{ always() }}
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
report-name: Summary of JUnit Tests
-15
View File
@@ -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
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

-36
View File
@@ -1,36 +0,0 @@
# Test Report
**✅ All tests passed**
## Test Results
| | Tests | Passed | Failed | Skipped |
|---|---|---|---|---|
| **Total** | 90 | 90 | 0 | 0 |
### Details
| Status | Suite | Tests | Passed | Failed | Skipped |
|---|---|---|---|---|---|
| ✅ | codes.thischwa.cf.CfBasicHttpClientTest | 9 | 9 | 0 | 0 |
| ✅ | codes.thischwa.cf.CfClientPenTest | 0 | 0 | 0 | 0 |
| ✅ | codes.thischwa.cf.CfClientTest | 0 | 0 | 0 | 0 |
| ✅ | codes.thischwa.cf.CfDnsClientBuilderTest | 16 | 16 | 0 | 0 |
| ✅ | codes.thischwa.cf.CfDnsClientMockTest | 16 | 16 | 0 | 0 |
| ✅ | codes.thischwa.cf.CfRequestTest | 8 | 8 | 0 | 0 |
| ✅ | codes.thischwa.cf.ObjectMapperTest | 2 | 2 | 0 | 0 |
| ✅ | codes.thischwa.cf.ResponseValidatorTest | 8 | 8 | 0 | 0 |
| ✅ | codes.thischwa.cf.fluent.FluentApiTest | 15 | 15 | 0 | 0 |
| ✅ | codes.thischwa.cf.model.BatchEntryTest | 2 | 2 | 0 | 0 |
| ✅ | codes.thischwa.cf.model.PagingRequestTest | 4 | 4 | 0 | 0 |
| ✅ | 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) |