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