siivous: scriptit env-pohjaisiksi, validointi, siistit kutsut
This commit is contained in:
@@ -29,6 +29,9 @@ jobs:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Validate CI config
|
||||
run: bash .ci/scripts/ci-validate.sh
|
||||
|
||||
- name: Run bats tests
|
||||
id: bats-tests
|
||||
shell: bash
|
||||
@@ -52,16 +55,16 @@ jobs:
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
bash .ci/scripts/publish-git-pages.sh "bats/" "$PAGES_HOST" "$GIT_PAGES_PUBLISH_URL" "$GIT_PAGES_PUBLISH_TOKEN"
|
||||
bash .ci/scripts/publish-git-pages.sh bats
|
||||
|
||||
- name: Set bats commit status
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${BATS_EXIT}" = "0" ]; then
|
||||
bash .ci/scripts/report-status.sh success "Bats tests" "" "$GITEA_API_URL" "$GITEA_TOKEN" "ci-bats" "$PAGES_HOST" "bats/"
|
||||
bash .ci/scripts/report-status.sh success "Bats tests" ci-bats bats
|
||||
else
|
||||
bash .ci/scripts/report-status.sh failure "Bats tests FAILED" "" "$GITEA_API_URL" "$GITEA_TOKEN" "ci-bats" "$PAGES_HOST" "bats/"
|
||||
bash .ci/scripts/report-status.sh failure "Bats tests FAILED" ci-bats bats
|
||||
fi
|
||||
|
||||
cucumber:
|
||||
@@ -75,6 +78,9 @@ jobs:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Validate CI config
|
||||
run: bash .ci/scripts/ci-validate.sh
|
||||
|
||||
- name: Prepare cucumber
|
||||
id: prepare-cucumber
|
||||
shell: bash
|
||||
@@ -110,7 +116,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${TOOL_OK}" = "true" ]; then
|
||||
bash .ci/scripts/publish-git-pages.sh "cucumber/" "$PAGES_HOST" "$GIT_PAGES_PUBLISH_URL" "$GIT_PAGES_PUBLISH_TOKEN"
|
||||
bash .ci/scripts/publish-git-pages.sh cucumber
|
||||
fi
|
||||
|
||||
- name: Set cucumber commit status
|
||||
@@ -118,11 +124,11 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${TOOL_OK}" != "true" ]; then
|
||||
bash .ci/scripts/report-status.sh failure "Cucumber tool unavailable" "" "$GITEA_API_URL" "$GITEA_TOKEN" "ci-cucumber" "$PAGES_HOST"
|
||||
bash .ci/scripts/report-status.sh failure "Cucumber tool unavailable" ci-cucumber
|
||||
elif [ "${CUCUMBER_EXIT}" = "0" ]; then
|
||||
bash .ci/scripts/report-status.sh success "Cucumber tests passed" "" "$GITEA_API_URL" "$GITEA_TOKEN" "ci-cucumber" "$PAGES_HOST" "cucumber/"
|
||||
bash .ci/scripts/report-status.sh success "Cucumber tests passed" ci-cucumber cucumber
|
||||
else
|
||||
bash .ci/scripts/report-status.sh failure "Cucumber tests FAILED" "" "$GITEA_API_URL" "$GITEA_TOKEN" "ci-cucumber" "$PAGES_HOST" "cucumber/"
|
||||
bash .ci/scripts/report-status.sh failure "Cucumber tests FAILED" ci-cucumber cucumber
|
||||
fi
|
||||
|
||||
build:
|
||||
@@ -135,10 +141,13 @@ jobs:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Validate CI config
|
||||
run: bash .ci/scripts/ci-validate.sh
|
||||
|
||||
- name: Generate report index
|
||||
shell: bash
|
||||
run: bash .ci/.gitea/scripts/generate-report-index.sh
|
||||
|
||||
- name: Set build commit status
|
||||
run: |
|
||||
bash .ci/scripts/report-status.sh success "Build complete" "" "$GITEA_API_URL" "$GITEA_TOKEN" "ci-build" "$PAGES_HOST"
|
||||
bash .ci/scripts/report-status.sh success "Build complete" ci-build
|
||||
|
||||
@@ -14,14 +14,14 @@ on:
|
||||
jobs:
|
||||
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
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Publish reports
|
||||
run: |
|
||||
bash scripts/publish.sh "reports" \
|
||||
"https://gitea.app.keskikuja.site" \
|
||||
"${{ secrets.GITEA_TOKEN }}" \
|
||||
"ci-reports.helm-dev.keskikuja.site" \
|
||||
"https://ci-reports.helm-dev.keskikuja.site" \
|
||||
"${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}"
|
||||
run: bash scripts/publish.sh reports
|
||||
|
||||
Reference in New Issue
Block a user