This commit is contained in:
@@ -1,89 +1,29 @@
|
||||
name: CI Engine
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
config-file:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GITEA_TOKEN:
|
||||
required: true
|
||||
GIT_PAGES_PUBLISH_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
unit:
|
||||
publish:
|
||||
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 }}
|
||||
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_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 reports
|
||||
run: bash scripts/publish.sh reports
|
||||
|
||||
- name: Publish unit test report
|
||||
id: publish-unit
|
||||
- name: Set commit status
|
||||
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"
|
||||
REPORT_URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/"
|
||||
bash scripts/report-status.sh success "Reports published" "$REPORT_URL" ci-publish
|
||||
|
||||
Reference in New Issue
Block a user