Mirror mic-check's Gitea/GitHub CI-CD pipeline for novelly
Dual-engine workflow (.github/workflows/ci.yml, read by both GitHub Actions and Gitea Actions): build, test, coverage badge on every push; on Gitea main pushes only, build+push API/web images to the Gitea registry and redeploy the persistent LAN stack via the shared [self-hosted, qa] runner. Replaces the ad hoc docker-compose.deploy.yml manual workflow with deploy/qa/docker-compose.qa.yml, pulled by CI — data volume preserved across deploys (no -v on down), unlike mic-check's throwaway QA stack.
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# Turns the Cobertura output from test.sh into a badge + summary via reportgenerator,
|
||||
# prints it, appends a build-report summary when running under Actions, and refreshes
|
||||
# the coverage badge committed at badges/coverage.svg. Readme embeds that badge via a
|
||||
# relative path, which resolves on both GitHub and Gitea since the same repo content is
|
||||
# pushed to both remotes.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" && source ./lib.sh
|
||||
cd "$CI_ROOT"
|
||||
|
||||
ensure_dotnet
|
||||
ensure_reportgenerator
|
||||
|
||||
REPORT_DIR="$CI_ROOT/coverage/report"
|
||||
|
||||
log "Generating coverage report with reportgenerator"
|
||||
reportgenerator \
|
||||
-reports:"coverage/dotnet/coverage.cobertura.xml" \
|
||||
-targetdir:"$REPORT_DIR" \
|
||||
-reporttypes:"Badges;MarkdownSummaryGithub;TextSummary"
|
||||
|
||||
cat "$REPORT_DIR/Summary.txt"
|
||||
|
||||
if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then
|
||||
cat "$REPORT_DIR/SummaryGithub.md" >> "$GITHUB_STEP_SUMMARY"
|
||||
fi
|
||||
|
||||
mkdir -p "$CI_ROOT/badges"
|
||||
cp "$REPORT_DIR/badge_linecoverage.svg" "$CI_ROOT/badges/coverage.svg"
|
||||
|
||||
log "coverage.sh complete"
|
||||
Reference in New Issue
Block a user