c81121c3d5
Final residual translations found in code/comments/CI: - .doorstop.yml: config comments, traceability mapping comments - Doxyfile: header comment - tools/render_plantuml.py: docstring - tools/generate_test_report.py: docstring - tests/unit_test_framework.h: doxygen brief + body - tests/unit/test_safety_manager.c: section comment - src/stubs/*.h: doxygen briefs for diag/display/inclinometer/logger/service/wheel-speed - .gitea/workflows/release.yml: release notes 'Statische Analyse' + deploy error message
194 lines
7.8 KiB
YAML
194 lines
7.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
build-essential gcc make cppcheck lcov \
|
|
python3 python3-pip ca-certificates \
|
|
doxygen graphviz \
|
|
jq curl
|
|
|
|
- name: Tag from ref
|
|
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
- name: Build + tests + coverage + Test-Report
|
|
run: |
|
|
make test
|
|
make coverage
|
|
make test-report
|
|
|
|
- name: Traceability + diagrams + API doc
|
|
run: |
|
|
python3 tools/traceability.py publish docs/traceability
|
|
python3 tools/render_plantuml.py
|
|
make docs
|
|
|
|
- name: Cppcheck Report (XML + HTML)
|
|
run: |
|
|
mkdir -p build
|
|
cppcheck --enable=all --inconclusive --xml --xml-version=2 \
|
|
-I src src 2> build/cppcheck-report.xml || true
|
|
cppcheck-htmlreport \
|
|
--file=build/cppcheck-report.xml \
|
|
--report-dir=build/cppcheck-html \
|
|
--source-dir=. \
|
|
--title="demo-epb Cppcheck Report" || echo "htmlreport skipped"
|
|
|
|
- name: Landing page
|
|
run: make landing-page
|
|
|
|
- name: Package release bundle
|
|
run: |
|
|
BUNDLE="release/demo-epb-${TAG}"
|
|
mkdir -p "$BUNDLE"/{coverage,traceability,diagrams,api-doc,reports/cppcheck,docs,src,tests}
|
|
|
|
# Landing page in the bundle root
|
|
cp build/index.html "$BUNDLE/index.html"
|
|
|
|
# CI-generierte Artefakte
|
|
cp -r build/coverage-html/* "$BUNDLE/coverage/" 2>/dev/null || true
|
|
cp -r docs/traceability/* "$BUNDLE/traceability/"
|
|
cp -r docs/diagrams/* "$BUNDLE/diagrams/"
|
|
cp -r build/api-doc/html/* "$BUNDLE/api-doc/" 2>/dev/null || true
|
|
cp build/cppcheck-report.xml "$BUNDLE/reports/" 2>/dev/null || true
|
|
cp -r build/cppcheck-html/* "$BUNDLE/reports/cppcheck/" 2>/dev/null || true
|
|
cp build/test-report.html "$BUNDLE/reports/" 2>/dev/null || true
|
|
cp build/test-report.md "$BUNDLE/reports/" 2>/dev/null || true
|
|
|
|
# Source-Code zum Anklicken aus dem Bundle (begrenzt auf das wichtigste)
|
|
cp -r src/*.c src/*.h "$BUNDLE/src/" 2>/dev/null || true
|
|
cp -r src/stubs "$BUNDLE/src/" 2>/dev/null || true
|
|
|
|
# All Word documents (plans, safety, manuals, audit artefacts)
|
|
mkdir -p "$BUNDLE/docs/plaene" "$BUNDLE/docs/safety" "$BUNDLE/docs/manuals" \
|
|
"$BUNDLE/docs/reviews" "$BUNDLE/docs/non-conformities" "$BUNDLE/misra/records"
|
|
cp -r docs/plaene/* "$BUNDLE/docs/plaene/" 2>/dev/null || true
|
|
cp -r docs/safety/* "$BUNDLE/docs/safety/" 2>/dev/null || true
|
|
cp -r docs/manuals/* "$BUNDLE/docs/manuals/" 2>/dev/null || true
|
|
cp -r docs/reviews/* "$BUNDLE/docs/reviews/" 2>/dev/null || true
|
|
cp -r docs/non-conformities/* "$BUNDLE/docs/non-conformities/" 2>/dev/null || true
|
|
cp -r misra/records/* "$BUNDLE/misra/records/" 2>/dev/null || true
|
|
|
|
# Source archive
|
|
git archive --format=tar.gz \
|
|
--prefix="demo-epb-${TAG}/" \
|
|
HEAD -o "release/demo-epb-${TAG}-source.tar.gz"
|
|
|
|
# Artefakt-Archiv (Engineering + Docs zusammen)
|
|
tar -czf "release/demo-epb-${TAG}-artifacts.tar.gz" -C release "demo-epb-${TAG}"
|
|
|
|
ls -la release/
|
|
|
|
- name: Generate release notes
|
|
run: |
|
|
cat > release/RELEASE_NOTES.md <<EOF
|
|
# demo-epb ${TAG}
|
|
|
|
Complete demo of the slohmaier Dev Process anhand einer
|
|
EPB-Steuergeraet-Software.
|
|
|
|
## Release bundle contents
|
|
|
|
| Asset | Content |
|
|
|-------|--------|
|
|
| \`demo-epb-${TAG}-source.tar.gz\` | Full source code (git archive) |
|
|
| \`demo-epb-${TAG}-artifacts.tar.gz\` | All generated and curated documents |
|
|
|
|
### Im Artefakt-Bundle enthalten
|
|
|
|
**Engineering (CI-generated):**
|
|
- \`coverage/\` — gcov/lcov HTML coverage report
|
|
- \`traceability/\` — Bidirectional traceability matrix as HTML + JSON
|
|
- \`diagrams/\` — PlantUML architecture diagrams as SVG
|
|
- \`api-doc/\` — Doxygen-generated API documentation
|
|
- \`reports/cppcheck-report.xml\` — Static analysis + MISRA
|
|
- \`reports/test-report.html\` — Test summary with requirement mapping
|
|
|
|
**Documents (Word, curated):**
|
|
- \`docs/plaene/\` — PID, PM-/QA-/SWE-/Test-Plan
|
|
- \`docs/safety/\` — HARA, Safety Case, FMEDA, MISRA-Compliance, Verification-Report, Tool-Qualification
|
|
- \`docs/manuals/\` — User-Manual + Service-Manual
|
|
- \`docs/reviews/\` — Review-Protokoll(e)
|
|
- \`docs/non-conformities/\` — Non-conformity entries
|
|
- \`docs/misra/\` — MISRA Deviation Records
|
|
|
|
## Build evidence
|
|
|
|
- All 46 unit tests green (Linux runner required)
|
|
- Coverage measured with gcov/lcov
|
|
- Static analysis with Cppcheck (0 findings)
|
|
- MISRA C:2012 compliance confirmed (1 Advisory deviation)
|
|
- Traceability verified bidirectionally (50 items)
|
|
|
|
## References
|
|
|
|
- Methodology: https://gitea.slohmaier.com/slohmaier/dev-process
|
|
- Commit: ${{ github.sha }}
|
|
- Built: $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
EOF
|
|
|
|
- name: Create Gitea release + upload assets
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
OWNER="${GITHUB_REPOSITORY_OWNER}"
|
|
REPO="${GITHUB_REPOSITORY##*/}"
|
|
API="${GITHUB_SERVER_URL}/api/v1"
|
|
|
|
BODY=$(jq -Rs '.' < release/RELEASE_NOTES.md)
|
|
RESP=$(curl -sf -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"tag_name\":\"${TAG}\",\"name\":\"demo-epb ${TAG}\",\"body\":${BODY},\"draft\":false,\"prerelease\":false}" \
|
|
"${API}/repos/${OWNER}/${REPO}/releases" || \
|
|
curl -sf -H "Authorization: token ${GITEA_TOKEN}" \
|
|
"${API}/repos/${OWNER}/${REPO}/releases/tags/${TAG}")
|
|
RELEASE_ID=$(echo "$RESP" | jq -r '.id')
|
|
echo "Release-ID: $RELEASE_ID"
|
|
|
|
for f in release/demo-epb-${TAG}-source.tar.gz \
|
|
release/demo-epb-${TAG}-artifacts.tar.gz; do
|
|
NAME=$(basename "$f")
|
|
echo "Uploading $NAME ..."
|
|
curl -sf -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/gzip" \
|
|
--data-binary "@$f" \
|
|
"${API}/repos/${OWNER}/${REPO}/releases/${RELEASE_ID}/assets?name=${NAME}"
|
|
done
|
|
|
|
echo "Release verfuegbar unter ${GITHUB_SERVER_URL}/${OWNER}/${REPO}/releases/tag/${TAG}"
|
|
|
|
- name: Deploy to gitea.slohmaier.com/pages/demo-epb/
|
|
run: |
|
|
DEPLOY=/var/www/pages/demo-epb
|
|
if [ ! -d "$DEPLOY" ]; then
|
|
echo "Mount $DEPLOY missing - check runner config. Skip."
|
|
exit 0
|
|
fi
|
|
BUNDLE="release/demo-epb-${TAG}"
|
|
rm -rf "$DEPLOY"/*
|
|
cp -r "$BUNDLE"/. "$DEPLOY/"
|
|
echo "https://gitea.slohmaier.com/pages/demo-epb/ updated to ${TAG}"
|
|
|
|
- name: Upload artifacts (backup as CI artifact)
|
|
uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: release-${{ env.TAG }}
|
|
path: release/
|