90 lines
2.8 KiB
YAML
90 lines
2.8 KiB
YAML
name: CI Engine
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
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 unit test report
|
|
run: |
|
|
SHA8="${GITHUB_SHA:0:8}"
|
|
mkdir -p "reports/${SHA8}"
|
|
cat > "reports/${SHA8}/unit-tests.html" <<EOF
|
|
<!DOCTYPE html>
|
|
<html lang="fi">
|
|
<head><meta charset="utf-8"><title>Unit tests - ${SHA8}</title></head>
|
|
<body>
|
|
<h1>Unit Tests</h1>
|
|
<p>Commit: ${GITHUB_SHA}</p>
|
|
<p>Branch: ${GITHUB_REF_NAME}</p>
|
|
<p>Status: passed</p>
|
|
</body>
|
|
</html>
|
|
EOF
|
|
|
|
- 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}/unit-tests.html" >> "${GITHUB_OUTPUT}"
|
|
|
|
- name: Set unit test commit status
|
|
run: |
|
|
bash scripts/report-status.sh \
|
|
success \
|
|
"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"
|