From 0eaddf7ba5b58887d35ee9371882ac7940cedcd9 Mon Sep 17 00:00:00 2001 From: "release-github-action[bot]" <154503118+release-github-action[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:23:15 +0200 Subject: [PATCH 1/3] Update github-actions to 4.15.0 (#171) * Add separate workdir parameter to run test script action * Add generic scripts * Add generic phpunit files * Fix runslim using wrong vars * Fix PE/EE template referencing the wrong branch for nightlies --- .../oxid-esales/defaults/defaults_light.yaml | 7 ++ .../oxid-esales/defaults/defaults_light.yml | 7 ++ .github/oxid-esales/defaults/ee.yaml | 26 ++--- .github/oxid-esales/defaults/ee.yml | 26 ++--- .github/oxid-esales/defaults/pe.yaml | 20 ++-- .github/oxid-esales/defaults/pe.yml | 20 ++-- .../oxid-esales/defaults/scripts/check_log.sh | 52 ++++++++++ .../defaults/scripts/codeception.sh | 97 +++++++++++++++++++ .../scripts/codeception_failure_pattern.txt | 17 ++++ .../defaults/scripts/integration.sh | 80 +++++++++++++++ .../scripts/integration_failure_pattern.txt | 17 ++++ .../defaults/scripts/php-cs-report.sh | 53 ++++++++++ .../defaults/scripts/phpmd-report.sh | 60 ++++++++++++ .../defaults/scripts/phpstan-report.sh | 62 ++++++++++++ .../defaults/scripts/phpunit10.xml | 27 ++++++ .../oxid-esales/defaults/scripts/phpunit9.xml | 31 ++++++ .github/oxid-esales/defaults/scripts/unit.sh | 80 +++++++++++++++ .../defaults/scripts/unit_failure_pattern.txt | 17 ++++ .../workflows/universal_workflow_light.yaml | 41 +++++--- .../workflows/universal_workflow_light.yml | 41 +++++--- prepare_shop/action.yaml | 29 ++++++ run_test_script/action.yaml | 18 +++- 22 files changed, 755 insertions(+), 73 deletions(-) create mode 100755 .github/oxid-esales/defaults/scripts/check_log.sh create mode 100644 .github/oxid-esales/defaults/scripts/codeception.sh create mode 100644 .github/oxid-esales/defaults/scripts/codeception_failure_pattern.txt create mode 100644 .github/oxid-esales/defaults/scripts/integration.sh create mode 100644 .github/oxid-esales/defaults/scripts/integration_failure_pattern.txt create mode 100644 .github/oxid-esales/defaults/scripts/php-cs-report.sh create mode 100644 .github/oxid-esales/defaults/scripts/phpmd-report.sh create mode 100644 .github/oxid-esales/defaults/scripts/phpstan-report.sh create mode 100644 .github/oxid-esales/defaults/scripts/phpunit10.xml create mode 100644 .github/oxid-esales/defaults/scripts/phpunit9.xml create mode 100644 .github/oxid-esales/defaults/scripts/unit.sh create mode 100644 .github/oxid-esales/defaults/scripts/unit_failure_pattern.txt diff --git a/.github/oxid-esales/defaults/defaults_light.yaml b/.github/oxid-esales/defaults/defaults_light.yaml index c68300cd..5e39f20b 100644 --- a/.github/oxid-esales/defaults/defaults_light.yaml +++ b/.github/oxid-esales/defaults/defaults_light.yaml @@ -201,6 +201,9 @@ install: # The path for the script to install the shop script: 'source/vendor/oxid-esales/oxideshop-ce/.github/oxid-esales/install.sh' + # Copy the default test scripts to these target folders (multiline possible, one folder per line) + copy_script_targets: tests/scripts + # This step installs the sdk, shop and module(s) install_shop_with_modules: matrix: *matrix @@ -314,6 +317,10 @@ runscript: &runscript # The path pointing to the module relative to source/dev-packages needs to be the same as in install_module path: '' + # The working directory to when executing the script in the docker container. If not set, this + # defaults to the value of path + workdir: '~' + # Should we run composer install in the workdir? run_composer_install: true diff --git a/.github/oxid-esales/defaults/defaults_light.yml b/.github/oxid-esales/defaults/defaults_light.yml index c68300cd..5e39f20b 100644 --- a/.github/oxid-esales/defaults/defaults_light.yml +++ b/.github/oxid-esales/defaults/defaults_light.yml @@ -201,6 +201,9 @@ install: # The path for the script to install the shop script: 'source/vendor/oxid-esales/oxideshop-ce/.github/oxid-esales/install.sh' + # Copy the default test scripts to these target folders (multiline possible, one folder per line) + copy_script_targets: tests/scripts + # This step installs the sdk, shop and module(s) install_shop_with_modules: matrix: *matrix @@ -314,6 +317,10 @@ runscript: &runscript # The path pointing to the module relative to source/dev-packages needs to be the same as in install_module path: '' + # The working directory to when executing the script in the docker container. If not set, this + # defaults to the value of path + workdir: '~' + # Should we run composer install in the workdir? run_composer_install: true diff --git a/.github/oxid-esales/defaults/ee.yaml b/.github/oxid-esales/defaults/ee.yaml index 45223ae2..8b34942a 100644 --- a/.github/oxid-esales/defaults/ee.yaml +++ b/.github/oxid-esales/defaults/ee.yaml @@ -30,17 +30,17 @@ install_shop_with_modules: &install "ddoe/*": "source" }, "require": { - "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/oxideshop-ee": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component-ee": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/oxideshop-ee": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component-ee": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/apex-theme": "{{ .Data.global.composer.ref_name }}" }, "require-dev": { - "oxid-esales/codeception-modules": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/codeception-modules": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" }, "repositories": { "oxid-esales/twig-component-ee": { @@ -118,10 +118,10 @@ runtest: transform: | { "require-dev": { - "oxid-esales/testing-library": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-ee": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/testing-library": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-ee": "{{ .Data.global.composer.ref_name }}", "codeception/module-webdriver": "^3.1", "phpunit/phpunit": "^9.1.1" }, diff --git a/.github/oxid-esales/defaults/ee.yml b/.github/oxid-esales/defaults/ee.yml index 45223ae2..8b34942a 100644 --- a/.github/oxid-esales/defaults/ee.yml +++ b/.github/oxid-esales/defaults/ee.yml @@ -30,17 +30,17 @@ install_shop_with_modules: &install "ddoe/*": "source" }, "require": { - "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/oxideshop-ee": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component-ee": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/oxideshop-ee": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component-ee": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/apex-theme": "{{ .Data.global.composer.ref_name }}" }, "require-dev": { - "oxid-esales/codeception-modules": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/codeception-modules": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" }, "repositories": { "oxid-esales/twig-component-ee": { @@ -118,10 +118,10 @@ runtest: transform: | { "require-dev": { - "oxid-esales/testing-library": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-ee": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/testing-library": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-ee": "{{ .Data.global.composer.ref_name }}", "codeception/module-webdriver": "^3.1", "phpunit/phpunit": "^9.1.1" }, diff --git a/.github/oxid-esales/defaults/pe.yaml b/.github/oxid-esales/defaults/pe.yaml index f84ec845..8f90ca94 100644 --- a/.github/oxid-esales/defaults/pe.yaml +++ b/.github/oxid-esales/defaults/pe.yaml @@ -30,15 +30,15 @@ install_shop_with_modules: &install "ddoe/*": "source" }, "require": { - "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/apex-theme": "{{ .Data.global.composer.ref_name }}" }, "require-dev": { - "oxid-esales/codeception-modules": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/codeception-modules": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" }, "repositories": { "oxid-esales/twig-component-pe": { @@ -108,9 +108,9 @@ runtest: transform: | { "require-dev": { - "oxid-esales/testing-library": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/testing-library": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.ref_name }}", "codeception/module-webdriver": "^3.1", "phpunit/phpunit": "^9.1.1" }, diff --git a/.github/oxid-esales/defaults/pe.yml b/.github/oxid-esales/defaults/pe.yml index f84ec845..8f90ca94 100644 --- a/.github/oxid-esales/defaults/pe.yml +++ b/.github/oxid-esales/defaults/pe.yml @@ -30,15 +30,15 @@ install_shop_with_modules: &install "ddoe/*": "source" }, "require": { - "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-component-pe": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/oxideshop-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-component-pe": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/apex-theme": "{{ .Data.global.composer.ref_name }}" }, "require-dev": { - "oxid-esales/codeception-modules": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.dev_ref }}" + "oxid-esales/codeception-modules": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" }, "repositories": { "oxid-esales/twig-component-pe": { @@ -108,9 +108,9 @@ runtest: transform: | { "require-dev": { - "oxid-esales/testing-library": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.dev_ref }}", - "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/testing-library": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.ref_name }}", + "oxid-esales/tests-deprecated-pe": "{{ .Data.global.composer.ref_name }}", "codeception/module-webdriver": "^3.1", "phpunit/phpunit": "^9.1.1" }, diff --git a/.github/oxid-esales/defaults/scripts/check_log.sh b/.github/oxid-esales/defaults/scripts/check_log.sh new file mode 100755 index 00000000..53341a74 --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/check_log.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Usage: +# check_log.sh path/to/log path/to/failure/patterns +# check_log checks if a given log file is not empty or contains patterns that are +# listed in the pattern file. +# It requires two inputs: +# The first input is the name of the log file to check, and the second input is the +# pattern file, where every line contains a grep -E compatible pattern to search for +# The script returns 0, if the log file exists, is not empty and does not contain any +# of the patterns in the pattern file. It returns 1 otherwise + +LOG_FILE="${1}" +PATTERN_FILE="${2}" +RESULT=0 + +if [ ! -e "${LOG_FILE}" ]; then + echo -e "\033[0;31mLog file '${LOG_FILE}' does not exist! Seems like no tests have been run!\033[0m" + RESULT=1 +fi + +if [ ! -s "${LOG_FILE}" ]; then + echo -e "\033[0;31mLog file '${LOG_FILE}' is empty! Seems like no tests have been run!\033[0m" + RESULT=1 +fi +if [ ! -f "${PATTERN_FILE}" ]; then + echo -e "\033[0;31mPattern file '${PATTERN_FILE}' does not exist!\033[0m" + RESULT=1 +fi +[[ ${RESULT} -gt 0 ]] && exit 1 + +# shellcheck disable=SC2016 +sed -e 's|(.*)\r|$1|' -i "${PATTERN_FILE}" +while read -r LINE ; do + if [ -n "${LINE}" ]; then + if grep -q -E "${LINE}" "${LOG_FILE}"; then + echo -e "\033[0;31m Log contains matching pattern ${LINE}\033[0m" + grep -E "${LINE}" "${LOG_FILE}" + RESULT=1 + else + echo -e "\033[0;32m Log dioes not contain matching pattern ${LINE}" + fi + fi +done <"${PATTERN_FILE}" + +if [ -s "/var/sync/logs/error_log.txt" ]; then + echo -e "\033[0;31mPHP error log is not empty!\033[0m" + cat /var/sync/logs/error_log.txt + RESULT=1 +fi + +exit ${RESULT} diff --git a/.github/oxid-esales/defaults/scripts/codeception.sh b/.github/oxid-esales/defaults/scripts/codeception.sh new file mode 100644 index 00000000..7ca25c3e --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/codeception.sh @@ -0,0 +1,97 @@ +#!/bin/bash +set -e +SUITE="${1}" + +function init() { + # shellcheck disable=SC2128 + if [[ ${BASH_SOURCE} = */* ]]; then + SCRIPT_DIR=${BASH_SOURCE%/*}/ + else + SCRIPT_DIR=./ + fi + if [ -z "${ABSOLUTE_PATH}" ]; then + ABSOLUTE_PATH="$(pwd)" + else + ABSOLUTE_PATH="/var/www/${ABSOLUTE_PATH}" + fi + TESTDIR='tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + TESTDIR='Tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + echo -e "\033[0;31m### Could not find folder tests or Tests in ${ABSOLUTE_PATH} ###\033[0m" + exit 1 + fi + fi + + [[ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Output" ]] && mkdir "${ABSOLUTE_PATH}/${TESTDIR}/Output" + [[ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Output" ]] && mkdir "${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + OUTPUT_DIR="${ABSOLUTE_PATH}/${TESTDIR}/Output" + REPORT_DIR="${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + if [ -z "${SELENIUM_SERVER_HOST}" ]; then + SELENIUM_SERVER_HOST='selenium' + fi + + if [ -z "${SUITE}" ]; then + SUITE="Acceptance" + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Codeception/${SUITE}" ]; then + SUITE="acceptance" + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Codeception/${SUITE}" ]; then + echo -e "\033[0;31mCould not find suite Acceptance or acceptance in ${TESTDIR}/Codeception\033[0m" + exit 1 + fi + fi + fi + LOG_FILE="${OUTPUT_DIR}/codeception_${SUITE}.txt" + PATTERN_FILE="${SCRIPT_DIR}/codeception_failure_pattern.txt" + + CODECEPT="vendor/bin/codecept" + if [ ! -f "${CODECEPT}" ]; then + CODECEPT="/var/www/${CODECEPT}" + if [ ! -f "${CODECEPT}" ]; then + echo -e "\033[0;31mCould not find codecept in vendor/bin or /var/www/vendor/bin\033[0m" + exit 1 + fi + fi + + cat <&1 \ +| tee "${LOG_FILE}" +RESULT=$? +echo "Codecept run exited with error code ${RESULT}" +"$SCRIPT_DIR/check_log.sh" "${LOG_FILE}" "${PATTERN_FILE}" diff --git a/.github/oxid-esales/defaults/scripts/codeception_failure_pattern.txt b/.github/oxid-esales/defaults/scripts/codeception_failure_pattern.txt new file mode 100644 index 00000000..a11a852c --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/codeception_failure_pattern.txt @@ -0,0 +1,17 @@ +fail +\\.\\=\\= +Warning +Notice +Deprecated +Fatal +Error +DID NOT FINISH +Test file ".+" not found +Cannot open file +No tests executed +Could not read +Warnings: [1-9][0-9]* +Errors: [1-9][0-9]* +Failed: [1-9][0-9]* +Deprecations: [1-9][0-9]* +Risky: [1-9][0-9]* diff --git a/.github/oxid-esales/defaults/scripts/integration.sh b/.github/oxid-esales/defaults/scripts/integration.sh new file mode 100644 index 00000000..ef80c948 --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/integration.sh @@ -0,0 +1,80 @@ +#!/bin/bash +set -e +export XDEBUG_MODE=coverage +function init() { + # shellcheck disable=SC2128 + if [[ ${BASH_SOURCE} = */* ]]; then + SCRIPT_DIR=${BASH_SOURCE%/*}/ + else + SCRIPT_DIR=./ + fi + if [ -z "${ABSOLUTE_PATH}" ]; then + ABSOLUTE_PATH="$(pwd)" + else + ABSOLUTE_PATH="/var/www/${ABSOLUTE_PATH}" + fi + TESTDIR='tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + TESTDIR='Tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + echo -e "\033[0;31m### Could not find folder tests or Tests in ${ABSOLUTE_PATH} ###\033[0m" + exit 1 + fi + fi + [[ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Output" ]] && mkdir "${ABSOLUTE_PATH}/${TESTDIR}/Output" + [[ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Output" ]] && mkdir "${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + OUTPUT_DIR="${ABSOLUTE_PATH}/${TESTDIR}/Output" + REPORT_DIR="${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + if [ -z "${SUITE}" ]; then + SUITE="${ABSOLUTE_PATH}/${TESTDIR}/Integration" + fi + + LOG_FILE="${OUTPUT_DIR}/phpunit_integration.txt" + PATTERN_FILE="${SCRIPT_DIR}/integration_failure_pattern.txt" + + PHPUNIT="vendor/bin/phpunit" + if [ ! -f "${PHPUNIT}" ]; then + PHPUNIT="/var/www/${PHPUNIT}" + if [ ! -f "${PHPUNIT}" ]; then + echo -e "\033[0;31mCould not find phpunit in vendor/bin or /var/www/vendor/bin\033[0m" + exit 1 + fi + fi + + BOOTSTRAP="/var/www/source/bootstrap.php" + if [ ! -f "${BOOTSTRAP}" ]; then + BOOTSTRAP="/var/www/vendor/oxid-esales/oxideshop-ce/${TESTDIR}/bootstrap.php" + if [ ! -f "${BOOTSTRAP}" ]; then + echo -e "\033[0;31mCould not find bootstrap.php in /var/www/tests or /var/www/oxid-esales/oxideshop-ce/tests\033[0m" + find /var/www -iname "bootstrap.php" + exit 1 + fi + fi + + XML_FILE="${ABSOLUTE_PATH}/tests/phpunit.xml" + COVERAGE_FILE="${REPORT_DIR}/coverage_phpunit_integration.xml" + + cat <&1 \ +| tee "${LOG_FILE}" +RESULT=$? +echo "phpunit exited with error code ${RESULT}" +"${SCRIPT_DIR}/check_log.sh" "${LOG_FILE}" "${PATTERN_FILE}" diff --git a/.github/oxid-esales/defaults/scripts/integration_failure_pattern.txt b/.github/oxid-esales/defaults/scripts/integration_failure_pattern.txt new file mode 100644 index 00000000..a11a852c --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/integration_failure_pattern.txt @@ -0,0 +1,17 @@ +fail +\\.\\=\\= +Warning +Notice +Deprecated +Fatal +Error +DID NOT FINISH +Test file ".+" not found +Cannot open file +No tests executed +Could not read +Warnings: [1-9][0-9]* +Errors: [1-9][0-9]* +Failed: [1-9][0-9]* +Deprecations: [1-9][0-9]* +Risky: [1-9][0-9]* diff --git a/.github/oxid-esales/defaults/scripts/php-cs-report.sh b/.github/oxid-esales/defaults/scripts/php-cs-report.sh new file mode 100644 index 00000000..db58c11e --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/php-cs-report.sh @@ -0,0 +1,53 @@ +#!/bin/bash +set -e +set -x +function init() { + if [[ ${BASH_SOURCE} = */* ]]; then + SCRIPT_DIR=${BASH_SOURCE%/*}/ + else + SCRIPT_DIR=./ + fi + if [ -z "${ABSOLUTE_PATH}" ]; then + ABSOLUTE_PATH="$(pwd)" + else + ABSOLUTE_PATH="/var/www/${ABSOLUTE_PATH}" + fi + TESTDIR='tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + TESTDIR='Tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + echo -e "\033[0;31m### Could not find folder tests or Tests in ${ABSOLUTE_PATH} ###\033[0m" + exit 1 + fi + fi + [[ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Reports" ]] && mkdir "${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + REPORT_DIR="${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + if [ -x vendor/bin/phpcs ]; then + PHPCS=vendor/bin/phpcs + else + if [ -x /var/www/vendor/bin/phpcs ]; then + PHPCS=/var/www/vendor/bin/phpcs + else + echo "Can't find phpcs in vendor/bin or /var/www/vendor/bin" + exit 1 + fi + fi + + XML_FILE="${ABSOLUTE_PATH}/${TESTDIR}/phpcs.xml" + REPORT_FILE="${REPORT_DIR}phpcs.report.json" + cat <"${REPORT_FILE}" diff --git a/.github/oxid-esales/defaults/scripts/phpunit10.xml b/.github/oxid-esales/defaults/scripts/phpunit10.xml new file mode 100644 index 00000000..f182e090 --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/phpunit10.xml @@ -0,0 +1,27 @@ + + + + + + ./Unit + + + tests/Integration + + + + + ../src + + + diff --git a/.github/oxid-esales/defaults/scripts/phpunit9.xml b/.github/oxid-esales/defaults/scripts/phpunit9.xml new file mode 100644 index 00000000..6a46f4b6 --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/phpunit9.xml @@ -0,0 +1,31 @@ + + + + + ../src + + + + + ./Unit + + + ./Integration + + + diff --git a/.github/oxid-esales/defaults/scripts/unit.sh b/.github/oxid-esales/defaults/scripts/unit.sh new file mode 100644 index 00000000..9ec673b6 --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/unit.sh @@ -0,0 +1,80 @@ +#!/bin/bash +set -e +export XDEBUG_MODE=coverage +function init() { + # shellcheck disable=SC2128 + if [[ ${BASH_SOURCE} = */* ]]; then + SCRIPT_DIR=${BASH_SOURCE%/*}/ + else + SCRIPT_DIR=./ + fi + if [ -z "${ABSOLUTE_PATH}" ]; then + ABSOLUTE_PATH="$(pwd)" + else + ABSOLUTE_PATH="/var/www/${ABSOLUTE_PATH}" + fi + TESTDIR='tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + TESTDIR='Tests' + if [ ! -d "${ABSOLUTE_PATH}/${TESTDIR}" ]; then + echo -e "\033[0;31m### Could not find folder tests or Tests in ${ABSOLUTE_PATH} ###\033[0m" + exit 1 + fi + fi + [[ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Output" ]] && mkdir "${ABSOLUTE_PATH}/${TESTDIR}/Output" + [[ ! -d "${ABSOLUTE_PATH}/${TESTDIR}/Output" ]] && mkdir "${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + OUTPUT_DIR="${ABSOLUTE_PATH}/${TESTDIR}/Output" + REPORT_DIR="${ABSOLUTE_PATH}/${TESTDIR}/Reports" + + if [ -z "${SUITE}" ]; then + SUITE="${ABSOLUTE_PATH}/${TESTDIR}/Unit" + fi + + LOG_FILE="${OUTPUT_DIR}/phpunit_unit.txt" + PATTERN_FILE="${SCRIPT_DIR}/unit_failure_pattern.txt" + + PHPUNIT="vendor/bin/phpunit" + if [ ! -f "${PHPUNIT}" ]; then + PHPUNIT="/var/www/${PHPUNIT}" + if [ ! -f "${PHPUNIT}" ]; then + echo -e "\033[0;31mCould not find phpunit in vendor/bin or /var/www/vendor/bin\033[0m" + exit 1 + fi + fi + + BOOTSTRAP="/var/www/source/bootstrap.php" + if [ ! -f "${BOOTSTRAP}" ]; then + BOOTSTRAP="/var/www/vendor/oxid-esales/oxideshop-ce/${TESTDIR}/bootstrap.php" + if [ ! -f "${BOOTSTRAP}" ]; then + echo -e "\033[0;31mCould not find bootstrap.php in /var/www/tests or /var/www/oxid-esales/oxideshop-ce/tests\033[0m" + find /var/www -iname "bootstrap.php" + exit 1 + fi + fi + + XML_FILE="${ABSOLUTE_PATH}/${TESTDIR}/phpunit.xml" + COVERAGE_FILE="${REPORT_DIR}/coverage_phpunit_unit.xml" + + cat <&1 \ +| tee "${LOG_FILE}" +RESULT=$? +echo "phpunit exited with error code ${RESULT}" +"${SCRIPT_DIR}/check_log.sh" "${LOG_FILE}" "${PATTERN_FILE}" diff --git a/.github/oxid-esales/defaults/scripts/unit_failure_pattern.txt b/.github/oxid-esales/defaults/scripts/unit_failure_pattern.txt new file mode 100644 index 00000000..a87c0fba --- /dev/null +++ b/.github/oxid-esales/defaults/scripts/unit_failure_pattern.txt @@ -0,0 +1,17 @@ +fail +\\.\\=\\= +Warning +Notice +Deprecated +Fatal +Error +DID NOT FINISH +Test file ".+" not found +Cannot open file +No tests executed +Could not read +Warnings: [1-9][0-9]* +Errors: [1-9][0-9]* +Failed: [1-9][0-9]* +Deprecations: [1-9][0-9]* +Risky: [1-9][0-9]* \ No newline at end of file diff --git a/.github/workflows/universal_workflow_light.yaml b/.github/workflows/universal_workflow_light.yaml index 7beef909..2777eb6e 100644 --- a/.github/workflows/universal_workflow_light.yaml +++ b/.github/workflows/universal_workflow_light.yaml @@ -337,6 +337,7 @@ jobs: composer_update_options: ${{ steps.iltp.outputs.install_composer_update_options}} composer_dev_ref: ${{ steps.iltp.outputs.install_composer_dev_ref}} enterprise_github_token: ${{ secrets.enterprise_github_token || github.token }} + copy_script_targets: ${{ steps.iltp.outputs.install_copy_script_targets }} debug: ${{ needs.init.outputs.debug }} - name: Run composer for each module @@ -399,16 +400,12 @@ jobs: rm .composer_merge.tmp.json fi echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runslim_${PREFIX}_path, ${E}\033[0m" - docker compose ${{ steps.iltp.outputs.install_shop_with_modules_container_method }} -T \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_options }} \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_name }} \ - composer update ${{ steps.iltp.outputs.install_shop_with_modules_composer_update_options}} -d "/var/www/${COMPOSER_PATH}" + docker compose ${{ steps.iltp.outputs.install_container_method }} -T \ + ${{ steps.iltp.outputs.install_container_options }} \ + ${{ steps.iltp.outputs.install_container_name }} \ + composer update ${{ steps.iltp.outputs.install_composer_update_options}} -d "/var/www/${COMPOSER_PATH}" fi done - docker compose ${{ steps.iltp.outputs.install_shop_with_modules_container_method }} -T \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_options }} \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_name }} \ - composer update ${{ steps.iltp.outputs.install_shop_with_modules_composer_update_options}} rm -rf ./load_testplan - name: Generate debugging script for running composer for each module @@ -790,10 +787,20 @@ jobs: ${!VAR} runscript_${KEY}_delimeter EOF - export "runslim_${KEY}"="${!VAR}" + export "runscript_${KEY}"="${!VAR}" done - if [ "${runslim_composer_early}" == 'false' ]; then - echo 'runslim_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}" + if [ "${runscript_composer_early}" == 'false' ]; then + echo 'runscript_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}" + fi + # If runscript_workdir is ~, it will be set to the value of runscript_path + VAR="runscript_${PREFIX}_workdir" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR='runscript_workdir' + fi + if [ "${!VAR}" == '~' ]; then + echo "runscript_workdir=${runscript_path}"| tee -a "${GITHUB_OUTPUT}" + else + echo "runscript_workdir=${!VAR}"| tee -a "${GITHUB_OUTPUT}" fi SUFFIX="${PREFIX}_${SCRIPT}-${{ steps.rstn.outputs.matrix_suffix }}" echo "runscript_suffix=${SUFFIX}"| \ @@ -868,6 +875,7 @@ jobs: with: script: ${{ steps.rt.outputs.runscript_script }} path: ${{ steps.rt.outputs.runscript_path }} + workdir: ${{ steps.rt.outputs.runscript_workdir }} run_composer_install: ${{ steps.rt.outputs.runscript_run_composer_install }} install_options: ${{ steps.rt.outputs.runscript_install_options }} container_name: ${{ steps.rt.outputs.runscript_container_name }} @@ -988,6 +996,16 @@ jobs: if [ "${runslim_composer_early}" == 'false' ]; then echo 'runslim_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}" fi + # If runslim_workdir is ~, it will be set to the value of runslim_path + VAR="runslim_${PREFIX}_workdir" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR='runslim_workdir' + fi + if [ "${!VAR}" == '~' ]; then + echo "runslim_workdir=${runslim_path}"| tee -a "${GITHUB_OUTPUT}" + else + echo "runslim_workdir=${!VAR}"| tee -a "${GITHUB_OUTPUT}" + fi SUFFIX="${PREFIX}_${SCRIPT}-${{ steps.rstn.outputs.matrix_suffix }}" echo "runslim_suffix=${SUFFIX}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" echo "runslim_title=${PREFIX}_${SCRIPT}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" @@ -1052,6 +1070,7 @@ jobs: with: script: ${{ steps.rt.outputs.runslim_script }} path: ${{ steps.rt.outputs.runslim_path }} + workdir: ${{ steps.rt.outputs.runslim_workdir }} run_composer_install: ${{ steps.rt.outputs.runslim_run_composer_install }} install_options: ${{ steps.rt.outputs.runslim_install_options }} container_name: ${{ steps.rt.outputs.runslim_container_name }} diff --git a/.github/workflows/universal_workflow_light.yml b/.github/workflows/universal_workflow_light.yml index 7beef909..2777eb6e 100644 --- a/.github/workflows/universal_workflow_light.yml +++ b/.github/workflows/universal_workflow_light.yml @@ -337,6 +337,7 @@ jobs: composer_update_options: ${{ steps.iltp.outputs.install_composer_update_options}} composer_dev_ref: ${{ steps.iltp.outputs.install_composer_dev_ref}} enterprise_github_token: ${{ secrets.enterprise_github_token || github.token }} + copy_script_targets: ${{ steps.iltp.outputs.install_copy_script_targets }} debug: ${{ needs.init.outputs.debug }} - name: Run composer for each module @@ -399,16 +400,12 @@ jobs: rm .composer_merge.tmp.json fi echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runslim_${PREFIX}_path, ${E}\033[0m" - docker compose ${{ steps.iltp.outputs.install_shop_with_modules_container_method }} -T \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_options }} \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_name }} \ - composer update ${{ steps.iltp.outputs.install_shop_with_modules_composer_update_options}} -d "/var/www/${COMPOSER_PATH}" + docker compose ${{ steps.iltp.outputs.install_container_method }} -T \ + ${{ steps.iltp.outputs.install_container_options }} \ + ${{ steps.iltp.outputs.install_container_name }} \ + composer update ${{ steps.iltp.outputs.install_composer_update_options}} -d "/var/www/${COMPOSER_PATH}" fi done - docker compose ${{ steps.iltp.outputs.install_shop_with_modules_container_method }} -T \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_options }} \ - ${{ steps.iltp.outputs.install_shop_with_modules_container_name }} \ - composer update ${{ steps.iltp.outputs.install_shop_with_modules_composer_update_options}} rm -rf ./load_testplan - name: Generate debugging script for running composer for each module @@ -790,10 +787,20 @@ jobs: ${!VAR} runscript_${KEY}_delimeter EOF - export "runslim_${KEY}"="${!VAR}" + export "runscript_${KEY}"="${!VAR}" done - if [ "${runslim_composer_early}" == 'false' ]; then - echo 'runslim_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}" + if [ "${runscript_composer_early}" == 'false' ]; then + echo 'runscript_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}" + fi + # If runscript_workdir is ~, it will be set to the value of runscript_path + VAR="runscript_${PREFIX}_workdir" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR='runscript_workdir' + fi + if [ "${!VAR}" == '~' ]; then + echo "runscript_workdir=${runscript_path}"| tee -a "${GITHUB_OUTPUT}" + else + echo "runscript_workdir=${!VAR}"| tee -a "${GITHUB_OUTPUT}" fi SUFFIX="${PREFIX}_${SCRIPT}-${{ steps.rstn.outputs.matrix_suffix }}" echo "runscript_suffix=${SUFFIX}"| \ @@ -868,6 +875,7 @@ jobs: with: script: ${{ steps.rt.outputs.runscript_script }} path: ${{ steps.rt.outputs.runscript_path }} + workdir: ${{ steps.rt.outputs.runscript_workdir }} run_composer_install: ${{ steps.rt.outputs.runscript_run_composer_install }} install_options: ${{ steps.rt.outputs.runscript_install_options }} container_name: ${{ steps.rt.outputs.runscript_container_name }} @@ -988,6 +996,16 @@ jobs: if [ "${runslim_composer_early}" == 'false' ]; then echo 'runslim_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}" fi + # If runslim_workdir is ~, it will be set to the value of runslim_path + VAR="runslim_${PREFIX}_workdir" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR='runslim_workdir' + fi + if [ "${!VAR}" == '~' ]; then + echo "runslim_workdir=${runslim_path}"| tee -a "${GITHUB_OUTPUT}" + else + echo "runslim_workdir=${!VAR}"| tee -a "${GITHUB_OUTPUT}" + fi SUFFIX="${PREFIX}_${SCRIPT}-${{ steps.rstn.outputs.matrix_suffix }}" echo "runslim_suffix=${SUFFIX}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" echo "runslim_title=${PREFIX}_${SCRIPT}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" @@ -1052,6 +1070,7 @@ jobs: with: script: ${{ steps.rt.outputs.runslim_script }} path: ${{ steps.rt.outputs.runslim_path }} + workdir: ${{ steps.rt.outputs.runslim_workdir }} run_composer_install: ${{ steps.rt.outputs.runslim_run_composer_install }} install_options: ${{ steps.rt.outputs.runslim_install_options }} container_name: ${{ steps.rt.outputs.runslim_container_name }} diff --git a/prepare_shop/action.yaml b/prepare_shop/action.yaml index 8a6b4bae..455b0bf9 100644 --- a/prepare_shop/action.yaml +++ b/prepare_shop/action.yaml @@ -175,6 +175,11 @@ inputs: required: false description: 'secrets.DOCKER_HUB_TOKEN for docker login' default: '' + copy_script_targets: + type: string + description: 'Copy the test scripts to these target folders' + default: 'tests/scripts' + required: false debug: type: string description: 'Appended to debugging scripts' @@ -496,3 +501,27 @@ runs: if [ -f source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php.dist ]; then cp source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php.dist source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php fi + + - name: 'Copy test scripts' + if: ${{ inputs.copy_script_targets != '' }} + shell: bash + run: | + # prepare_shop: Copy tests scripts + ${{ inputs.debug }} + cat >targets.tmp < Date: Tue, 30 Jul 2024 09:43:40 +0200 Subject: [PATCH 2/3] Update github-actions to 4.15.1 (#172) * Add actionlint dependencies on private runner --- .github/workflows/call-universal_test_workflow.yaml | 2 +- .github/workflows/call-universal_test_workflow.yml | 2 +- .github/workflows/universal_workflow_light.yaml | 2 +- .github/workflows/universal_workflow_light.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/call-universal_test_workflow.yaml b/.github/workflows/call-universal_test_workflow.yaml index 44ff7791..36785f93 100644 --- a/.github/workflows/call-universal_test_workflow.yaml +++ b/.github/workflows/call-universal_test_workflow.yaml @@ -1696,7 +1696,7 @@ jobs: if [ -z "${NPM}" ]; then echo -e "\033[0;35m### Installing npm ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm + sudo apt-get -qq install npm shellcheck pipx fi - name: Checkout diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index 44ff7791..36785f93 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -1696,7 +1696,7 @@ jobs: if [ -z "${NPM}" ]; then echo -e "\033[0;35m### Installing npm ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm + sudo apt-get -qq install npm shellcheck pipx fi - name: Checkout diff --git a/.github/workflows/universal_workflow_light.yaml b/.github/workflows/universal_workflow_light.yaml index 2777eb6e..a0ffe44b 100644 --- a/.github/workflows/universal_workflow_light.yaml +++ b/.github/workflows/universal_workflow_light.yaml @@ -1249,7 +1249,7 @@ jobs: if [ -z "${NPM}" ]; then echo -e "\033[0;35m### Installing npm ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm + sudo apt-get -qq install npm shellcheck pipx fi - name: Checkout diff --git a/.github/workflows/universal_workflow_light.yml b/.github/workflows/universal_workflow_light.yml index 2777eb6e..a0ffe44b 100644 --- a/.github/workflows/universal_workflow_light.yml +++ b/.github/workflows/universal_workflow_light.yml @@ -1249,7 +1249,7 @@ jobs: if [ -z "${NPM}" ]; then echo -e "\033[0;35m### Installing npm ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm + sudo apt-get -qq install npm shellcheck pipx fi - name: Checkout From fdc4c751e68dcfcba60663aa1b30fc56991c6cdd Mon Sep 17 00:00:00 2001 From: "release-github-action[bot]" <154503118+release-github-action[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 12:46:22 +0200 Subject: [PATCH 3/3] Update github-actions to 4.15.2 (#173) * Add python3-venv --- .github/workflows/call-universal_test_workflow.yaml | 7 ++++--- .github/workflows/call-universal_test_workflow.yml | 7 ++++--- .github/workflows/universal_workflow_light.yaml | 7 ++++--- .github/workflows/universal_workflow_light.yml | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/call-universal_test_workflow.yaml b/.github/workflows/call-universal_test_workflow.yaml index 36785f93..4d506f4f 100644 --- a/.github/workflows/call-universal_test_workflow.yaml +++ b/.github/workflows/call-universal_test_workflow.yaml @@ -1693,10 +1693,11 @@ jobs: if: ${{ inputs.runs_on != '"ubuntu-latest"'}} run: | NPM=$(type -p 'npm'||true) - if [ -z "${NPM}" ]; then - echo -e "\033[0;35m### Installing npm ###\033[0m" + PIPX=$(type -p 'pipx'||true) + if [ -z "${NPM}" ] || [ -z "${PIPX}" ]; then + echo -e "\033[0;35m### Installing npm, shellcheck, pipx ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm shellcheck pipx + sudo apt-get -qq install npm shellcheck pipx python3-venv fi - name: Checkout diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index 36785f93..4d506f4f 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -1693,10 +1693,11 @@ jobs: if: ${{ inputs.runs_on != '"ubuntu-latest"'}} run: | NPM=$(type -p 'npm'||true) - if [ -z "${NPM}" ]; then - echo -e "\033[0;35m### Installing npm ###\033[0m" + PIPX=$(type -p 'pipx'||true) + if [ -z "${NPM}" ] || [ -z "${PIPX}" ]; then + echo -e "\033[0;35m### Installing npm, shellcheck, pipx ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm shellcheck pipx + sudo apt-get -qq install npm shellcheck pipx python3-venv fi - name: Checkout diff --git a/.github/workflows/universal_workflow_light.yaml b/.github/workflows/universal_workflow_light.yaml index a0ffe44b..5d194bc9 100644 --- a/.github/workflows/universal_workflow_light.yaml +++ b/.github/workflows/universal_workflow_light.yaml @@ -1246,10 +1246,11 @@ jobs: if: ${{ inputs.runs_on != '"ubuntu-latest"'}} run: | NPM=$(type -p 'npm'||true) - if [ -z "${NPM}" ]; then - echo -e "\033[0;35m### Installing npm ###\033[0m" + PIPX=$(type -p 'pipx'||true) + if [ -z "${NPM}" ] || [ -z "${PIPX}" ]; then + echo -e "\033[0;35m### Installing npm, shellcheck, pipx ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm shellcheck pipx + sudo apt-get -qq install npm shellcheck pipx python3-venv fi - name: Checkout diff --git a/.github/workflows/universal_workflow_light.yml b/.github/workflows/universal_workflow_light.yml index a0ffe44b..5d194bc9 100644 --- a/.github/workflows/universal_workflow_light.yml +++ b/.github/workflows/universal_workflow_light.yml @@ -1246,10 +1246,11 @@ jobs: if: ${{ inputs.runs_on != '"ubuntu-latest"'}} run: | NPM=$(type -p 'npm'||true) - if [ -z "${NPM}" ]; then - echo -e "\033[0;35m### Installing npm ###\033[0m" + PIPX=$(type -p 'pipx'||true) + if [ -z "${NPM}" ] || [ -z "${PIPX}" ]; then + echo -e "\033[0;35m### Installing npm, shellcheck, pipx ###\033[0m" sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update - sudo apt-get -qq install npm shellcheck pipx + sudo apt-get -qq install npm shellcheck pipx python3-venv fi - name: Checkout