poc testi
This commit is contained in:
@@ -3,7 +3,7 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
poc-report:
|
unit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
GITEA_API_URL: https://gitea.app.keskikuja.site
|
GITEA_API_URL: https://gitea.app.keskikuja.site
|
||||||
@@ -14,34 +14,76 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Generate POC report
|
- name: Generate unit test report
|
||||||
run: |
|
run: |
|
||||||
SHA8="${GITHUB_SHA:0:8}"
|
SHA8="${GITHUB_SHA:0:8}"
|
||||||
mkdir -p "reports/${SHA8}"
|
mkdir -p "reports/${SHA8}"
|
||||||
cat > "reports/${SHA8}/index.html" <<EOF
|
cat > "reports/${SHA8}/unit-tests.html" <<EOF
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fi">
|
<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>
|
<body>
|
||||||
<h1>git-pages POC</h1>
|
<h1>Unit Tests</h1>
|
||||||
<p>Commit: ${GITHUB_SHA}</p>
|
<p>Commit: ${GITHUB_SHA}</p>
|
||||||
<p>Branch: ${GITHUB_REF_NAME}</p>
|
<p>Branch: ${GITHUB_REF_NAME}</p>
|
||||||
<p>Run: ${GITHUB_RUN_ID}</p>
|
<p>Status: passed</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Publish report to git-pages
|
- name: Publish unit test report
|
||||||
id: publish
|
id: publish-unit
|
||||||
run: |
|
run: |
|
||||||
REPORT_BASE=$(bash scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}")
|
REPORT_BASE=$(bash scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}")
|
||||||
echo "report_url=${REPORT_BASE}/index.html" >> "${GITHUB_OUTPUT}"
|
echo "report_url=${REPORT_BASE}/unit-tests.html" >> "${GITHUB_OUTPUT}"
|
||||||
echo "Published: ${REPORT_BASE}/index.html"
|
|
||||||
|
|
||||||
- name: Set commit status with report link
|
- name: Set unit test commit status
|
||||||
run: |
|
run: |
|
||||||
bash scripts/report-status.sh \
|
bash scripts/report-status.sh \
|
||||||
success \
|
success \
|
||||||
"POC report published" \
|
"Unit tests passed" \
|
||||||
"${{ steps.publish.outputs.report_url }}" \
|
"${{ steps.publish-unit.outputs.report_url }}" \
|
||||||
"ci-report"
|
"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