This commit is contained in:
@@ -16,8 +16,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
PAGES_HOST: ci-reports.helm-dev.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 }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: niko/gitea-ci-library
|
||||||
|
path: .ci
|
||||||
|
|
||||||
- name: Run bats tests
|
- name: Run bats tests
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -28,12 +34,29 @@ jobs:
|
|||||||
docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} --formatter junit /code/tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/junit.xml" 2>&1 || true
|
docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} --formatter junit /code/tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/junit.xml" 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Publish bats reports
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/bats"
|
||||||
|
|
||||||
|
- name: Set bats commit status
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh success \
|
||||||
|
"Bats tests" \
|
||||||
|
"https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/" \
|
||||||
|
ci-bats
|
||||||
|
|
||||||
cucumber:
|
cucumber:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
PAGES_HOST: ci-reports.helm-dev.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 }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: niko/gitea-ci-library
|
||||||
|
path: .ci
|
||||||
|
|
||||||
- name: Run cucumber tests
|
- name: Run cucumber tests
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -45,6 +68,17 @@ jobs:
|
|||||||
npx cucumber-js \
|
npx cucumber-js \
|
||||||
--format json:"reports/${GITHUB_SHA:0:8}/cucumber/report.json"
|
--format json:"reports/${GITHUB_SHA:0:8}/cucumber/report.json"
|
||||||
|
|
||||||
|
- name: Publish cucumber reports
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/cucumber"
|
||||||
|
|
||||||
|
- name: Set cucumber commit status
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh success \
|
||||||
|
"Cucumber tests" \
|
||||||
|
"https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/cucumber/" \
|
||||||
|
ci-cucumber
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [bats, cucumber]
|
needs: [bats, cucumber]
|
||||||
@@ -62,6 +96,7 @@ jobs:
|
|||||||
- name: Generate report index
|
- name: Generate report index
|
||||||
run: |
|
run: |
|
||||||
SHA8="${GITHUB_SHA:0:8}"
|
SHA8="${GITHUB_SHA:0:8}"
|
||||||
|
mkdir -p "reports/${SHA8}"
|
||||||
BATS_PASS=$(grep -c 'ok' "reports/${SHA8}/bats/results.txt" 2>/dev/null || echo 0)
|
BATS_PASS=$(grep -c 'ok' "reports/${SHA8}/bats/results.txt" 2>/dev/null || echo 0)
|
||||||
BATS_FAIL=$(grep -c 'not ok' "reports/${SHA8}/bats/results.txt" 2>/dev/null || echo 0)
|
BATS_FAIL=$(grep -c 'not ok' "reports/${SHA8}/bats/results.txt" 2>/dev/null || echo 0)
|
||||||
CUCUMBER_PASS=$(jq '.summary.passed // 0' "reports/${SHA8}/cucumber/report.json" 2>/dev/null || echo 0)
|
CUCUMBER_PASS=$(jq '.summary.passed // 0' "reports/${SHA8}/cucumber/report.json" 2>/dev/null || echo 0)
|
||||||
@@ -84,6 +119,13 @@ jobs:
|
|||||||
echo "</table></body></html>"
|
echo "</table></body></html>"
|
||||||
} > "reports/${SHA8}/index.html"
|
} > "reports/${SHA8}/index.html"
|
||||||
|
|
||||||
- name: Publish reports
|
- name: Publish report index
|
||||||
run: |
|
run: |
|
||||||
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}"
|
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}"
|
||||||
|
|
||||||
|
- name: Set build commit status
|
||||||
|
run: |
|
||||||
|
bash .ci/scripts/report-status.sh success \
|
||||||
|
"Build complete" \
|
||||||
|
"https://gitea.app.keskikuja.site/niko/gitea-ci-library/actions/runs/${GITHUB_RUN_ID}" \
|
||||||
|
ci-build
|
||||||
|
|||||||
Reference in New Issue
Block a user