äölmhägou
This commit is contained in:
@@ -9,7 +9,7 @@ on:
|
|||||||
cucumber-node-image:
|
cucumber-node-image:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: node:20
|
default: node:22
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bats:
|
bats:
|
||||||
@@ -27,25 +27,10 @@ jobs:
|
|||||||
repository: niko/gitea-ci-library
|
repository: niko/gitea-ci-library
|
||||||
path: .ci
|
path: .ci
|
||||||
|
|
||||||
- name: Prepare bats
|
|
||||||
id: prepare-bats
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if docker run --rm ${{ inputs.bats-image }} --help > /dev/null 2>&1; then
|
|
||||||
echo "TOOL_OK=true" >> "${GITHUB_ENV}"
|
|
||||||
else
|
|
||||||
echo "TOOL_OK=false" >> "${GITHUB_ENV}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Run bats tests
|
- name: Run bats tests
|
||||||
if: always()
|
|
||||||
id: bats-tests
|
id: bats-tests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ "${TOOL_OK}" != "true" ]; then
|
|
||||||
echo "BATS_EXIT=1" >> "${GITHUB_ENV}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
mkdir -p "reports/${GITHUB_SHA:0:8}/bats"
|
mkdir -p "reports/${GITHUB_SHA:0:8}/bats"
|
||||||
set +e
|
set +e
|
||||||
docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} /code/tests/*.bats \
|
docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} /code/tests/*.bats \
|
||||||
@@ -67,19 +52,13 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ "${TOOL_OK}" = "true" ]; then
|
|
||||||
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/bats"
|
bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}/bats"
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Set bats commit status
|
- name: Set bats commit status
|
||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ "${TOOL_OK}" != "true" ]; then
|
if [ "${BATS_EXIT}" = "0" ]; then
|
||||||
STATUS="failure"
|
|
||||||
DESC="Bats tool unavailable"
|
|
||||||
URL="https://gitea.app.keskikuja.site/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
|
|
||||||
elif [ "${BATS_EXIT}" = "0" ]; then
|
|
||||||
STATUS="success"
|
STATUS="success"
|
||||||
DESC="Bats tests"
|
DESC="Bats tests"
|
||||||
URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/"
|
URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/bats/"
|
||||||
@@ -111,7 +90,8 @@ jobs:
|
|||||||
id: prepare-cucumber
|
id: prepare-cucumber
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if npx --package @cucumber/cucumber cucumber-js --dry-run tests/features/ > /dev/null 2>&1; then
|
if npm install @cucumber/cucumber > /dev/null 2>&1 && \
|
||||||
|
npx --package @cucumber/cucumber cucumber-js --dry-run tests/features/ > /dev/null 2>&1; then
|
||||||
echo "TOOL_OK=true" >> "${GITHUB_ENV}"
|
echo "TOOL_OK=true" >> "${GITHUB_ENV}"
|
||||||
else
|
else
|
||||||
echo "TOOL_OK=false" >> "${GITHUB_ENV}"
|
echo "TOOL_OK=false" >> "${GITHUB_ENV}"
|
||||||
@@ -128,7 +108,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
mkdir -p "reports/${GITHUB_SHA:0:8}/cucumber"
|
mkdir -p "reports/${GITHUB_SHA:0:8}/cucumber"
|
||||||
set +e
|
set +e
|
||||||
npx --package @cucumber/cucumber 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" \
|
||||||
--format html:"reports/${GITHUB_SHA:0:8}/cucumber/index.html" 2>&1
|
--format html:"reports/${GITHUB_SHA:0:8}/cucumber/index.html" 2>&1
|
||||||
CUCUMBER_EXIT=$?
|
CUCUMBER_EXIT=$?
|
||||||
|
|||||||
Reference in New Issue
Block a user