poc testi
This commit is contained in:
@@ -3,7 +3,7 @@ on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
poc-report:
|
||||
unit:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GITEA_API_URL: https://gitea.app.keskikuja.site
|
||||
@@ -14,34 +14,76 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Generate POC report
|
||||
- name: Generate unit test report
|
||||
run: |
|
||||
SHA8="${GITHUB_SHA:0:8}"
|
||||
mkdir -p "reports/${SHA8}"
|
||||
cat > "reports/${SHA8}/index.html" <<EOF
|
||||
cat > "reports/${SHA8}/unit-tests.html" <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html lang="fi">
|
||||
<head><meta charset="utf-8"><title>POC report ${SHA8}</title></head>
|
||||
<head><meta charset="utf-8"><title>Unit tests - ${SHA8}</title></head>
|
||||
<body>
|
||||
<h1>git-pages POC</h1>
|
||||
<h1>Unit Tests</h1>
|
||||
<p>Commit: ${GITHUB_SHA}</p>
|
||||
<p>Branch: ${GITHUB_REF_NAME}</p>
|
||||
<p>Run: ${GITHUB_RUN_ID}</p>
|
||||
<p>Status: passed</p>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
- name: Publish report to git-pages
|
||||
id: publish
|
||||
- name: Publish unit test report
|
||||
id: publish-unit
|
||||
run: |
|
||||
REPORT_BASE=$(bash scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}")
|
||||
echo "report_url=${REPORT_BASE}/index.html" >> "${GITHUB_OUTPUT}"
|
||||
echo "Published: ${REPORT_BASE}/index.html"
|
||||
echo "report_url=${REPORT_BASE}/unit-tests.html" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Set commit status with report link
|
||||
- name: Set unit test commit status
|
||||
run: |
|
||||
bash scripts/report-status.sh \
|
||||
success \
|
||||
"POC report published" \
|
||||
"${{ steps.publish.outputs.report_url }}" \
|
||||
"ci-report"
|
||||
"Unit tests passed" \
|
||||
"${{ steps.publish-unit.outputs.report_url }}" \
|
||||
"ci-unit"
|
||||
|
||||
build:
|
||||
needs: [unit]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GITEA_API_URL: https://gitea.app.keskikuja.site
|
||||
PAGES_HOST: ci-reports.helm-dev.keskikuja.site
|
||||
GIT_PAGES_PUBLISH_URL: https://ci-reports.helm-dev.keskikuja.site
|
||||
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Generate build report
|
||||
run: |
|
||||
SHA8="${GITHUB_SHA:0:8}"
|
||||
mkdir -p "reports/${SHA8}"
|
||||
cat > "reports/${SHA8}/build-report.html" <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html lang="fi">
|
||||
<head><meta charset="utf-8"><title>Docker build - ${SHA8}</title></head>
|
||||
<body>
|
||||
<h1>Docker Build</h1>
|
||||
<p>Commit: ${GITHUB_SHA}</p>
|
||||
<p>Image: app:${GITHUB_RUN_NUMBER}</p>
|
||||
<p>Status: pushed</p>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
- name: Publish build report
|
||||
id: publish-build
|
||||
run: |
|
||||
REPORT_BASE=$(bash scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}")
|
||||
echo "report_url=${REPORT_BASE}/build-report.html" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Set build commit status
|
||||
run: |
|
||||
bash scripts/report-status.sh \
|
||||
success \
|
||||
"Container built & pushed" \
|
||||
"${{ steps.publish-build.outputs.report_url }}" \
|
||||
"ci-build"
|
||||
|
||||
Reference in New Issue
Block a user