From 8d6e6a6bdc0c4d7659947144373bbf83775aede3 Mon Sep 17 00:00:00 2001 From: "release-github-action[bot]" <154503118+release-github-action[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 12:21:31 +0200 Subject: [PATCH] Update github-actions to 4.19.1 (#184) * Add all DBS templates * Add mysql-9 templates --- .github/dependabot.yaml.backup | 13 + .../oxid-esales/defaults/7.0.x.yaml.backup | 94 + .github/oxid-esales/defaults/7.0.x.yml.backup | 94 + .../oxid-esales/defaults/7.1.x.yaml.backup | 93 + .github/oxid-esales/defaults/7.1.x.yml.backup | 93 + .../oxid-esales/defaults/7.2.x.yaml.backup | 94 + .github/oxid-esales/defaults/7.2.x.yml.backup | 94 + .../oxid-esales/defaults/8.0.x.yaml.backup | 1 + .github/oxid-esales/defaults/8.0.x.yml.backup | 1 + .../oxid-esales/defaults/_rename.yaml.backup | 68 + .../defaults/component.yaml.backup | 46 + .../oxid-esales/defaults/component.yml.backup | 46 + .../oxid-esales/defaults/defaults.yaml.backup | 842 ++++++++ .../oxid-esales/defaults/defaults.yml.backup | 842 ++++++++ .../defaults/defaults_light.yaml.backup | 427 ++++ .../defaults/defaults_light.yml.backup | 427 ++++ .github/oxid-esales/defaults/ee.yaml.backup | 155 ++ .github/oxid-esales/defaults/ee.yml.backup | 155 ++ .../oxid-esales/defaults/module.yaml.backup | 46 + .../oxid-esales/defaults/module.yml.backup | 46 + ...ule_codeception_Acceptance_71x.yaml.backup | 25 + ...dule_codeception_Acceptance_71x.yml.backup | 25 + .../module_codeception_acceptance.yaml.backup | 25 + .../module_codeception_acceptance.yml.backup | 25 + .../module_phpunit_integration.yaml.backup | 19 + .../module_phpunit_integration.yml.backup | 19 + .../defaults/module_phpunit_unit.yaml.backup | 19 + .../defaults/module_phpunit_unit.yml.backup | 19 + .../defaults/module_styles.yaml.backup | 20 + .../defaults/module_styles.yml.backup | 20 + .github/oxid-esales/defaults/pe.yaml.backup | 139 ++ .github/oxid-esales/defaults/pe.yml.backup | 139 ++ .../defaults/php8.0_mysql5.7_only.yaml.backup | 50 + .../defaults/php8.0_mysql5.7_only.yml.backup | 50 + .../defaults/php8.0_mysql8.0_only.yaml.backup | 51 + .../defaults/php8.0_mysql8.0_only.yml.backup | 51 + .../oxid-esales/defaults/php8.1_all_dbs.yaml | 51 + .../defaults/php8.1_all_dbs.yaml.backup | 51 + .../php8.1_mariadb10_only.yaml.backup | 51 + .../php8.1_mariadb11_only.yaml.backup | 51 + .../defaults/php8.1_mysql5.7_only.yaml.backup | 51 + .../defaults/php8.1_mysql5.7_only.yml.backup | 51 + .../defaults/php8.1_mysql8.0_only.yaml.backup | 51 + .../defaults/php8.1_mysql8.0_only.yml.backup | 51 + .../defaults/php8.1_mysql8_only.yaml.backup | 51 + .../defaults/php8.1_mysql9_only.yaml | 51 + .../defaults/php8.1_mysql9_only.yaml.backup | 51 + .../oxid-esales/defaults/php8.2_all_dbs.yaml | 51 + .../defaults/php8.2_all_dbs.yaml.backup | 51 + .../php8.2_mariadb10_only.yaml.backup | 51 + .../php8.2_mariadb11_only.yaml.backup | 51 + .../defaults/php8.2_mysql5.7_only.yaml.backup | 51 + .../defaults/php8.2_mysql5.7_only.yml.backup | 51 + .../defaults/php8.2_mysql8.0_only.yaml.backup | 51 + .../defaults/php8.2_mysql8.0_only.yml.backup | 51 + .../defaults/php8.2_mysql8_only.yaml.backup | 51 + .../defaults/php8.2_mysql9_only.yaml | 51 + .../defaults/php8.2_mysql9_only.yaml.backup | 51 + .../oxid-esales/defaults/php8.3_all_dbs.yaml | 51 + .../defaults/php8.3_all_dbs.yaml.backup | 51 + .../php8.3_mariadb10_only.yaml.backup | 51 + .../php8.3_mariadb11_only.yaml.backup | 51 + .../defaults/php8.3_mysql5.7_only.yaml.backup | 51 + .../defaults/php8.3_mysql5.7_only.yml.backup | 51 + .../defaults/php8.3_mysql8.0_only.yaml.backup | 51 + .../defaults/php8.3_mysql8.0_only.yml.backup | 51 + .../defaults/php8.3_mysql8_only.yaml.backup | 51 + .../defaults/php8.3_mysql9_only.yaml | 51 + .../defaults/php8.3_mysql9_only.yaml.backup | 51 + .../oxid-esales/defaults/php8.4_all_dbs.yaml | 51 + .../defaults/php8.4_all_dbs.yaml.backup | 51 + .../php8.4_mariadb10_only.yaml.backup | 51 + .../php8.4_mariadb11_only.yaml.backup | 51 + .../defaults/php8.4_mysql5.7_only.yaml.backup | 51 + .../defaults/php8.4_mysql5.7_only.yml.backup | 51 + .../defaults/php8.4_mysql8.0_only.yaml.backup | 51 + .../defaults/php8.4_mysql8.0_only.yml.backup | 51 + .../defaults/php8.4_mysql8_only.yaml.backup | 51 + .../defaults/php8.4_mysql9_only.yaml | 51 + .../defaults/php8.4_mysql9_only.yaml.backup | 51 + .../defaults/scheduled.yaml.backup | 29 + .../oxid-esales/defaults/scheduled.yml.backup | 29 + .../call-universal_test_workflow.yaml.backup | 1795 +++++++++++++++++ .../call-universal_test_workflow.yml.backup | 1795 +++++++++++++++++ .../workflows/dispatch-release.yaml.backup | 112 + .github/workflows/merge-release.yaml.backup | 75 + .../push-validate_workflows.yaml.backup | 186 ++ .../workflows/universal_workflow_light.yaml | 9 + .../universal_workflow_light.yaml.backup | 1357 +++++++++++++ .../workflows/universal_workflow_light.yml | 9 + .../universal_workflow_light.yml.backup | 1357 +++++++++++++ append_report/action.yaml.backup | 166 ++ begin_report/action.yaml.backup | 185 ++ build_docker/action.yaml.backup | 57 + clean_cache/action.yaml.backup | 101 + cleanup_workspace/action.yaml.backup | 56 + codeception/action.yaml.backup | 189 ++ composer_merge/action.yaml.backup | 114 ++ consolidate_artifacts/action.yaml.backup | 53 + generate_report/action.yaml.backup | 230 +++ install_module/action.yaml.backup | 203 ++ install_shop/action.yaml.backup | 103 + load_cached_testplan/action.yaml.backup | 106 + phpcs/action.yaml.backup | 184 ++ phpmd/action.yaml.backup | 170 ++ phpstan/action.yaml.backup | 173 ++ phpunit/action.yaml.backup | 159 ++ prepare_shop/action.yaml.backup | 530 +++++ run_custom_scripts/action.yaml.backup | 75 + run_test_script/action.yaml.backup | 165 ++ runtests/action.yaml.backup | 177 ++ slack_status/action.yaml.backup | 135 ++ sonarcloud/action.yaml.backup | 170 ++ start_shop/action.yaml.backup | 155 ++ stop_shop/action.yaml.backup | 19 + styles/action.yaml.backup | 161 ++ yamllint/action.yaml.backup | 84 + 117 files changed, 17290 insertions(+) create mode 100644 .github/dependabot.yaml.backup create mode 100644 .github/oxid-esales/defaults/7.0.x.yaml.backup create mode 100644 .github/oxid-esales/defaults/7.0.x.yml.backup create mode 100644 .github/oxid-esales/defaults/7.1.x.yaml.backup create mode 100644 .github/oxid-esales/defaults/7.1.x.yml.backup create mode 100644 .github/oxid-esales/defaults/7.2.x.yaml.backup create mode 100644 .github/oxid-esales/defaults/7.2.x.yml.backup create mode 100644 .github/oxid-esales/defaults/8.0.x.yaml.backup create mode 100644 .github/oxid-esales/defaults/8.0.x.yml.backup create mode 100644 .github/oxid-esales/defaults/_rename.yaml.backup create mode 100644 .github/oxid-esales/defaults/component.yaml.backup create mode 100644 .github/oxid-esales/defaults/component.yml.backup create mode 100644 .github/oxid-esales/defaults/defaults.yaml.backup create mode 100644 .github/oxid-esales/defaults/defaults.yml.backup create mode 100644 .github/oxid-esales/defaults/defaults_light.yaml.backup create mode 100644 .github/oxid-esales/defaults/defaults_light.yml.backup create mode 100644 .github/oxid-esales/defaults/ee.yaml.backup create mode 100644 .github/oxid-esales/defaults/ee.yml.backup create mode 100644 .github/oxid-esales/defaults/module.yaml.backup create mode 100644 .github/oxid-esales/defaults/module.yml.backup create mode 100644 .github/oxid-esales/defaults/module_codeception_Acceptance_71x.yaml.backup create mode 100644 .github/oxid-esales/defaults/module_codeception_Acceptance_71x.yml.backup create mode 100644 .github/oxid-esales/defaults/module_codeception_acceptance.yaml.backup create mode 100644 .github/oxid-esales/defaults/module_codeception_acceptance.yml.backup create mode 100644 .github/oxid-esales/defaults/module_phpunit_integration.yaml.backup create mode 100644 .github/oxid-esales/defaults/module_phpunit_integration.yml.backup create mode 100644 .github/oxid-esales/defaults/module_phpunit_unit.yaml.backup create mode 100644 .github/oxid-esales/defaults/module_phpunit_unit.yml.backup create mode 100644 .github/oxid-esales/defaults/module_styles.yaml.backup create mode 100644 .github/oxid-esales/defaults/module_styles.yml.backup create mode 100644 .github/oxid-esales/defaults/pe.yaml.backup create mode 100644 .github/oxid-esales/defaults/pe.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.0_mysql5.7_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.0_mysql5.7_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.0_mysql8.0_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.0_mysql8.0_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_all_dbs.yaml create mode 100644 .github/oxid-esales/defaults/php8.1_all_dbs.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mariadb10_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mariadb11_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mysql5.7_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mysql5.7_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mysql8.0_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mysql8.0_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mysql8_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.1_mysql9_only.yaml create mode 100644 .github/oxid-esales/defaults/php8.1_mysql9_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_all_dbs.yaml create mode 100644 .github/oxid-esales/defaults/php8.2_all_dbs.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mariadb10_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mariadb11_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mysql5.7_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mysql5.7_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mysql8.0_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mysql8.0_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mysql8_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.2_mysql9_only.yaml create mode 100644 .github/oxid-esales/defaults/php8.2_mysql9_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_all_dbs.yaml create mode 100644 .github/oxid-esales/defaults/php8.3_all_dbs.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mariadb10_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mariadb11_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mysql5.7_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mysql5.7_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mysql8.0_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mysql8.0_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mysql8_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.3_mysql9_only.yaml create mode 100644 .github/oxid-esales/defaults/php8.3_mysql9_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_all_dbs.yaml create mode 100644 .github/oxid-esales/defaults/php8.4_all_dbs.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mariadb10_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mariadb11_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mysql5.7_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mysql5.7_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mysql8.0_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mysql8.0_only.yml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mysql8_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/php8.4_mysql9_only.yaml create mode 100644 .github/oxid-esales/defaults/php8.4_mysql9_only.yaml.backup create mode 100644 .github/oxid-esales/defaults/scheduled.yaml.backup create mode 100644 .github/oxid-esales/defaults/scheduled.yml.backup create mode 100644 .github/workflows/call-universal_test_workflow.yaml.backup create mode 100644 .github/workflows/call-universal_test_workflow.yml.backup create mode 100644 .github/workflows/dispatch-release.yaml.backup create mode 100644 .github/workflows/merge-release.yaml.backup create mode 100644 .github/workflows/push-validate_workflows.yaml.backup create mode 100644 .github/workflows/universal_workflow_light.yaml.backup create mode 100644 .github/workflows/universal_workflow_light.yml.backup create mode 100644 append_report/action.yaml.backup create mode 100644 begin_report/action.yaml.backup create mode 100644 build_docker/action.yaml.backup create mode 100644 clean_cache/action.yaml.backup create mode 100644 cleanup_workspace/action.yaml.backup create mode 100644 codeception/action.yaml.backup create mode 100644 composer_merge/action.yaml.backup create mode 100644 consolidate_artifacts/action.yaml.backup create mode 100644 generate_report/action.yaml.backup create mode 100644 install_module/action.yaml.backup create mode 100644 install_shop/action.yaml.backup create mode 100644 load_cached_testplan/action.yaml.backup create mode 100644 phpcs/action.yaml.backup create mode 100644 phpmd/action.yaml.backup create mode 100644 phpstan/action.yaml.backup create mode 100644 phpunit/action.yaml.backup create mode 100644 prepare_shop/action.yaml.backup create mode 100644 run_custom_scripts/action.yaml.backup create mode 100644 run_test_script/action.yaml.backup create mode 100644 runtests/action.yaml.backup create mode 100644 slack_status/action.yaml.backup create mode 100644 sonarcloud/action.yaml.backup create mode 100644 start_shop/action.yaml.backup create mode 100644 stop_shop/action.yaml.backup create mode 100644 styles/action.yaml.backup create mode 100644 yamllint/action.yaml.backup diff --git a/.github/dependabot.yaml.backup b/.github/dependabot.yaml.backup new file mode 100644 index 00000000..b83d80df --- /dev/null +++ b/.github/dependabot.yaml.backup @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/oxid-esales/defaults/7.0.x.yaml.backup b/.github/oxid-esales/defaults/7.0.x.yaml.backup new file mode 100644 index 00000000..8ec2f71b --- /dev/null +++ b/.github/oxid-esales/defaults/7.0.x.yaml.backup @@ -0,0 +1,94 @@ +workflow: + matrix: &matrix + php: &matrix_php '["8.0","8.1"]' + mysql: &matrix_mysql '["5.7","8.0.36"]' + matrix_slim: &matrix_slim + php: &matrix_php '["8.1"]' + mysql: &matrix_mysql '["5.7"]' + +global: + git: &git + default_ref: &default_ref 'b-7.0.x' + enterprise_ref: 'b-7.0.x' + + composer: &composer + dev_ref: &dev_ref dev-b-7.0.x + +install_shop_with_modules: &install + matrix: *matrix + git: *git + composer: + dev_ref: *dev_ref + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-7.0.x", + "oxid-esales/twig-admin-theme": "dev-b-7.0.x", + "oxid-esales/apex-theme": "dev-b-7.0.x" + } + } + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +install_shop: + matrix: *matrix + git: *git + +install_module: + matrix: *matrix + git: + module: + ref: *default_ref + composer: *composer +# END Deprecated + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix_slim + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + composer: *composer + suite: 'acceptance' + +runtest: + matrix: *matrix + composer: + transform: | + { + "require-dev": { + "oxid-esales/tests-deprecated-ce": "dev-b-7.0.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + +sonarcloud: + matrix: *matrix_slim + +phpcs_tests: + matrix: *matrix_slim + +phpmd: + matrix: *matrix_slim + +phpstan: + matrix: *matrix_slim + +styles: + matrix: *matrix_slim + composer: *composer + +finish: + matrix: *matrix diff --git a/.github/oxid-esales/defaults/7.0.x.yml.backup b/.github/oxid-esales/defaults/7.0.x.yml.backup new file mode 100644 index 00000000..8ec2f71b --- /dev/null +++ b/.github/oxid-esales/defaults/7.0.x.yml.backup @@ -0,0 +1,94 @@ +workflow: + matrix: &matrix + php: &matrix_php '["8.0","8.1"]' + mysql: &matrix_mysql '["5.7","8.0.36"]' + matrix_slim: &matrix_slim + php: &matrix_php '["8.1"]' + mysql: &matrix_mysql '["5.7"]' + +global: + git: &git + default_ref: &default_ref 'b-7.0.x' + enterprise_ref: 'b-7.0.x' + + composer: &composer + dev_ref: &dev_ref dev-b-7.0.x + +install_shop_with_modules: &install + matrix: *matrix + git: *git + composer: + dev_ref: *dev_ref + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-7.0.x", + "oxid-esales/twig-admin-theme": "dev-b-7.0.x", + "oxid-esales/apex-theme": "dev-b-7.0.x" + } + } + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +install_shop: + matrix: *matrix + git: *git + +install_module: + matrix: *matrix + git: + module: + ref: *default_ref + composer: *composer +# END Deprecated + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix_slim + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + composer: *composer + suite: 'acceptance' + +runtest: + matrix: *matrix + composer: + transform: | + { + "require-dev": { + "oxid-esales/tests-deprecated-ce": "dev-b-7.0.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + +sonarcloud: + matrix: *matrix_slim + +phpcs_tests: + matrix: *matrix_slim + +phpmd: + matrix: *matrix_slim + +phpstan: + matrix: *matrix_slim + +styles: + matrix: *matrix_slim + composer: *composer + +finish: + matrix: *matrix diff --git a/.github/oxid-esales/defaults/7.1.x.yaml.backup b/.github/oxid-esales/defaults/7.1.x.yaml.backup new file mode 100644 index 00000000..ae2e66d5 --- /dev/null +++ b/.github/oxid-esales/defaults/7.1.x.yaml.backup @@ -0,0 +1,93 @@ +workflow: + matrix: &matrix + php: &matrix_php '["8.1","8.2"]' + mysql: &matrix_mysql '["5.7","8.0.36"]' + matrix_slim: &matrix_slim + php: '["8.2"]' + mysql: '["8.0.36"]' +global: + git: &git + default_ref: &default_ref 'b-7.1.x' + enterprise_ref: 'b-7.1.x' + + composer: &composer + dev_ref: &dev_ref dev-b-7.1.x + +install_shop_with_modules: &install + matrix: *matrix + git: *git + composer: + dev_ref: *dev_ref + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-7.1.x", + "oxid-esales/twig-admin-theme": "dev-b-7.1.x", + "oxid-esales/apex-theme": "dev-b-7.1.x" + } + } + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +install_shop: + matrix: *matrix + git: *git + +install_module: + matrix: *matrix + git: + module: + ref: *default_ref + composer: *composer +# END Deprecated + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix_slim + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + composer: *composer + +runtest: + matrix: *matrix + composer: + transform: | + { + "require-dev": { + "oxid-esales/tests-deprecated-ce": "dev-b-7.1.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + + +sonarcloud: + matrix: *matrix_slim + +phpcs_tests: + matrix: *matrix_slim + +phpmd: + matrix: *matrix_slim + +phpstan: + matrix: *matrix_slim + +styles: + matrix: *matrix_slim + composer: *composer + +finish: + matrix: *matrix diff --git a/.github/oxid-esales/defaults/7.1.x.yml.backup b/.github/oxid-esales/defaults/7.1.x.yml.backup new file mode 100644 index 00000000..ae2e66d5 --- /dev/null +++ b/.github/oxid-esales/defaults/7.1.x.yml.backup @@ -0,0 +1,93 @@ +workflow: + matrix: &matrix + php: &matrix_php '["8.1","8.2"]' + mysql: &matrix_mysql '["5.7","8.0.36"]' + matrix_slim: &matrix_slim + php: '["8.2"]' + mysql: '["8.0.36"]' +global: + git: &git + default_ref: &default_ref 'b-7.1.x' + enterprise_ref: 'b-7.1.x' + + composer: &composer + dev_ref: &dev_ref dev-b-7.1.x + +install_shop_with_modules: &install + matrix: *matrix + git: *git + composer: + dev_ref: *dev_ref + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-7.1.x", + "oxid-esales/twig-admin-theme": "dev-b-7.1.x", + "oxid-esales/apex-theme": "dev-b-7.1.x" + } + } + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +install_shop: + matrix: *matrix + git: *git + +install_module: + matrix: *matrix + git: + module: + ref: *default_ref + composer: *composer +# END Deprecated + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix_slim + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + composer: *composer + +runtest: + matrix: *matrix + composer: + transform: | + { + "require-dev": { + "oxid-esales/tests-deprecated-ce": "dev-b-7.1.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + + +sonarcloud: + matrix: *matrix_slim + +phpcs_tests: + matrix: *matrix_slim + +phpmd: + matrix: *matrix_slim + +phpstan: + matrix: *matrix_slim + +styles: + matrix: *matrix_slim + composer: *composer + +finish: + matrix: *matrix diff --git a/.github/oxid-esales/defaults/7.2.x.yaml.backup b/.github/oxid-esales/defaults/7.2.x.yaml.backup new file mode 100644 index 00000000..d7890670 --- /dev/null +++ b/.github/oxid-esales/defaults/7.2.x.yaml.backup @@ -0,0 +1,94 @@ +workflow: + matrix: &matrix + # We only test the latest recommended versions here but both template engines + php: &matrix_php '["8.2","8.3"]' + mysql: &matrix_mysql '["5.7","8.0.36"]' + matrix_slim: &matrix_slim + php: '["8.2"]' + mysql: '["8.0.36"]' +global: + git: &git + default_ref: &default_ref 'b-7.2.x' + enterprise_ref: 'b-7.2.x' + + composer: &composer + dev_ref: &dev_ref dev-b-7.2.x + +install_shop_with_modules: &install + matrix: *matrix + git: *git + composer: + dev_ref: *dev_ref + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-7.2.x", + "oxid-esales/twig-admin-theme": "dev-b-7.2.x", + "oxid-esales/apex-theme": "dev-b-7.2.x" + } + } + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +install_shop: + matrix: *matrix + git: *git + +install_module: + matrix: *matrix + git: + module: + ref: *default_ref + composer: *composer +# END Deprecated + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix_slim + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + composer: *composer + +runtest: + matrix: *matrix + composer: + transform: | + { + "require-dev": { + "oxid-esales/tests-deprecated-ce": "dev-b-7.2.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + + +sonarcloud: + matrix: *matrix_slim + +phpcs_tests: + matrix: *matrix_slim + +phpmd: + matrix: *matrix_slim + +phpstan: + matrix: *matrix_slim + +styles: + matrix: *matrix_slim + composer: *composer + +finish: + matrix: *matrix diff --git a/.github/oxid-esales/defaults/7.2.x.yml.backup b/.github/oxid-esales/defaults/7.2.x.yml.backup new file mode 100644 index 00000000..d7890670 --- /dev/null +++ b/.github/oxid-esales/defaults/7.2.x.yml.backup @@ -0,0 +1,94 @@ +workflow: + matrix: &matrix + # We only test the latest recommended versions here but both template engines + php: &matrix_php '["8.2","8.3"]' + mysql: &matrix_mysql '["5.7","8.0.36"]' + matrix_slim: &matrix_slim + php: '["8.2"]' + mysql: '["8.0.36"]' +global: + git: &git + default_ref: &default_ref 'b-7.2.x' + enterprise_ref: 'b-7.2.x' + + composer: &composer + dev_ref: &dev_ref dev-b-7.2.x + +install_shop_with_modules: &install + matrix: *matrix + git: *git + composer: + dev_ref: *dev_ref + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-7.2.x", + "oxid-esales/twig-admin-theme": "dev-b-7.2.x", + "oxid-esales/apex-theme": "dev-b-7.2.x" + } + } + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +install_shop: + matrix: *matrix + git: *git + +install_module: + matrix: *matrix + git: + module: + ref: *default_ref + composer: *composer +# END Deprecated + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix_slim + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + composer: *composer + +runtest: + matrix: *matrix + composer: + transform: | + { + "require-dev": { + "oxid-esales/tests-deprecated-ce": "dev-b-7.2.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + + +sonarcloud: + matrix: *matrix_slim + +phpcs_tests: + matrix: *matrix_slim + +phpmd: + matrix: *matrix_slim + +phpstan: + matrix: *matrix_slim + +styles: + matrix: *matrix_slim + composer: *composer + +finish: + matrix: *matrix diff --git a/.github/oxid-esales/defaults/8.0.x.yaml.backup b/.github/oxid-esales/defaults/8.0.x.yaml.backup new file mode 100644 index 00000000..181e8a1a --- /dev/null +++ b/.github/oxid-esales/defaults/8.0.x.yaml.backup @@ -0,0 +1 @@ +# This is just an empty placeholder as defaults.yml covers the latest version diff --git a/.github/oxid-esales/defaults/8.0.x.yml.backup b/.github/oxid-esales/defaults/8.0.x.yml.backup new file mode 100644 index 00000000..181e8a1a --- /dev/null +++ b/.github/oxid-esales/defaults/8.0.x.yml.backup @@ -0,0 +1 @@ +# This is just an empty placeholder as defaults.yml covers the latest version diff --git a/.github/oxid-esales/defaults/_rename.yaml.backup b/.github/oxid-esales/defaults/_rename.yaml.backup new file mode 100644 index 00000000..5a2f4a10 --- /dev/null +++ b/.github/oxid-esales/defaults/_rename.yaml.backup @@ -0,0 +1,68 @@ +# This is a helper which renames fields to their new names +# It is needed before the implementation of the breaking changes +# in v5 of these actions + +global: + git: + # See https://stackoverflow.com/questions/25689829/arithmetic-in-go-templates#72465098 + # for an idea how to decrement the len of the by 4 and + # https://go.dev/play/p/XTqvu0J9Sw1 for a breakdown of this expression + # yamllint disable rule:line-length + repository: '{{ with .Data.global.git.repository }}{{ . }}{{ else }}{{ len (slice (printf "%*s" (len .Data.global.git.shop_url) "") 4) |slice .Data.global.git.shop_url 19 }}{{ end -}}' + ref: '{{ with .Data.global.git.ref }}{{ . }}{{ else }}{{ .Data.global.git.shop_ref }}{{ end -}}' + +install: + matrix: + php: '{{ if .Data.install.matrix.php }}{{ .Data.install.matrix.php }}{{ else }}{{ .Data.install_shop_with_modules.matrix.php }}{{ end }}' + mysql: '{{ if .Data.install.matrix.mysql }}{{ .Data.install.matrix.mysql }}{{ else }}{{ .Data.install_shop_with_modules.matrix.mysql }}{{ end }}' + max_parallel: '{{ if .Data.install.max_parallel }}{{ .Data.install.max_parallel }}{{ else }}{{ .Data.install_shop_with_modules.max_parallel }}{{ end }}' + docker_login: '{{ if .Data.install.docker_login }}{{ .Data.install.docker_login }}{{ else }}{{ .Data.install_shop_with_modules.docker_login }}{{ end }}' + container: + name: '{{ if .Data.install.container.name }}{{ .Data.install.container.name }}{{ else }}{{ .Data.install_shop_with_modules.container.name }}{{ end }}' + options: '{{ if .Data.install.container.options }}{{ .Data.install.container.options }}{{ else }}{{ .Data.install_shop_with_modules.container.options }}{{ end }}' + method: '{{ if .Data.install.container.method }}{{ .Data.install.container.method }}{{ else }}{{ .Data.install_shop_with_modules.container.method }}{{ end }}' + git: + sdk_url: '{{ if .Data.install.git.sdk_url }}{{ .Data.install.git.sdk_url }}{{ else }}{{ .Data.install_shop_with_modules.git.sdk_url }}{{ end }}' + sdk_repository: '{{ with .Data.install_shop_with_modules.git.sdk_repository }}{{ . }}{{ else }}{{ len (slice (printf "%*s" (len .Data.install_shop_with_modules.git.sdk_url) "") 4) |slice .Data.install_shop_with_modules.git.sdk_url 19 }}{{ end -}}' + sdk_ref: '{{ if .Data.install.git.sdk_ref }}{{ .Data.install.git.sdk_ref }}{{ else }}{{ .Data.install_shop_with_modules.git.sdk_ref }}{{ end }}' + # shop_url: '{{ if .Data.install.git.shop_url }}{{ .Data.install.git.shop_url }}{{ else }}{{ .Data.install_shop_with_modules.git.shop_url }}{{ end }}' + # shop_ref: '{{ if .Data.install.git.shop_ref }}{{ .Data.install.git.shop_ref }}{{ else }}{{ .Data.install_shop_with_modules.git.shop_ref }}{{ end }}' + repository: '{{ if .Data.install.git.repository }}{{ .Data.install.git.repository }}{{ else }}{{ len (slice (printf "%*s" (len .Data.install_shop_with_modules.git.shop_url) "") 4) |slice .Data.install_shop_with_modules.git.shop_url 19 }}{{ end -}}' + ref: '{{ if .Data.install.git.ref }}{{ .Data.install.git.ref }}{{ else }}{{ if .Data.install.git.shop_ref }}{{ .Data.install.git.shop_ref }}{{ else }}{{ .Data.install_shop_with_modules.git.shop_ref }}{{ end }}{{ end -}}' + enterprise_url: '{{ if .Data.install.git.enterprise_url }}{{ .Data.install.git.enterprise_url }}{{ else }}{{ .Data.install_shop_with_modules.git.enterprise_url }}{{ end }}' + enterprise_repository: '{{ if .Data.install.git.enterprise_rpository }}{{ .Data.install.git.enterprise_repository }}{{ else }}{{ len (slice (printf "%*s" (len .Data.install_shop_with_modules.git.enterprise_url) "") 4) |slice .Data.install_shop_with_modules.git.enterprise_url 19 }}{{ end -}}' + enterprise_ref: '{{ if .Data.install.git.enterprise_ref }}{{ .Data.install.git.enterprise_ref }}{{ else }}{{ .Data.install_shop_with_modules.git.enterprise_ref }}{{ end }}' + default_ref: '{{ if .Data.install.git.default_ref }}{{ .Data.install.git.default_ref }}{{ else }}{{ .Data.install_shop_with_modules.git.default_ref }}{{ end }}' + safe_ref_name: '{{ if .Data.install.git.safe_ref_name }}{{ .Data.install.git.safe_ref_name }}{{ else }}{{ .Data.install_shop_with_modules.git.safe_ref_name }}{{ end }}' + cache: + bucket: '{{ if .Data.install.cache.bucket }}{{ .Data.install.cache.bucket }}{{ else }}{{ .Data.install_shop_with_modules.cache.bucket }}{{ end }}' + prefix: '{{ if .Data.install.cache.prefix }}{{ .Data.install.cache.prefix }}{{ else }}{{ .Data.install_shop_with_modules.cache.prefix }}{{ end }}' + prepared_shop: '{{ if .Data.install.cache.prepared_shop }}{{ .Data.install.cache.prepared_shop }}{{ else }}{{ .Data.install_shop_with_modules.cache.prepared_shop }}{{ end }}' + prepared_shop_prefix: '{{ if .Data.install.cache.prepared_shop_prefix }}{{ .Data.install.cache.prepared_shop_prefix }}{{ else }}{{ .Data.install_shop_with_modules.cache.prepared_shop_prefix }}{{ end }}' + composer: + dev_ref: '{{ if .Data.install.composer.dev_ref }}{{ .Data.install.composer.dev_ref }}{{ else }}{{ .Data.install_shop_with_modules.composer.dev_ref }}{{ end }}' + ref_name: '{{ if .Data.install.composer.ref_name }}{{ .Data.install.composer.ref_name }}{{ else }}{{ .Data.install_shop_with_modules.composer.ref_name }}{{ end }}' + file: '{{ if .Data.install.composer.file }}{{ .Data.install.composer.file }}{{ else }}{{ .Data.install_shop_with_modules.composer.file }}{{ end }}' + backup: '{{ if .Data.install.composer.backup }}{{ .Data.install.composer.backup }}{{ else }}{{ .Data.install_shop_with_modules.composer.backup }}{{ end }}' + transform: | + {{ if .Data.install.composer.transform }}{{ indent .Data.install.composer.transform 6 }}{{ else }}{{ indent .Data.install_shop_with_modules.composer.transform 6 }}{{ end }} + update: '{{ if .Data.install.composer.update }}{{ .Data.install.composer.update }}{{ else }}{{ .Data.install_shop_with_modules.composer.update }}{{ end }}' + update_options: '{{ if .Data.install.composer.update_options }}{{ .Data.install.composer.update_options }}{{ else }}{{ .Data.install_shop_with_modules.composer.update_options }}{{ end }}' + root_url: '{{ if .Data.install.composer.root_url }}{{ .Data.install.composer.root_url }}{{ else }}{{ .Data.install_shop_with_modules.composer.root_url }}{{ end }}' + early: '{{ if .Data.install.composer.early }}{{ .Data.install.composer.early }}{{ else }}{{ .Data.install_shop_with_modules.composer.early }}{{ end }}' + custom_ini: + error_reporting: '{{ if .Data.install.custom_ini.error_reporting }}{{ .Data.install.custom_ini.error_reporting }}{{ else }}{{ .Data.install_shop_with_modules.custom_ini.error_reporting }}{{ end }}' + xdebug: '{{ if .Data.install.custom_ini.xdebug }}{{ .Data.install.custom_ini.xdebug }}{{ else }}{{ .Data.install_shop_with_modules.custom_ini.xdebug }}{{ end }}' + add_services: '{{ if .Data.install.add_services }}{{ .Data.install.add_services }}{{ else }}{{ .Data.install_shop_with_modules.add_services }}{{ end }}' + config: + idebug: '{{ if .Data.install.config.idebug }}{{ .Data.install.config.idebug }}{{ else }}{{ .Data.install_shop_with_modules.config.idebug }}{{ end }}' + custom_script: | + {{ if .Data.install.custom_script }}{{ indent .Data.install.custom_script 4 }}{{ else }}{{ indent .Data.install_shop_with_modules.custom_script 4 }}{{ end }} + custom_script_container: | + {{ if .Data.install.custom_script_container }}{{ indent .Data.install.custom_script_container 4 }}{{ else }}{{ indent .Data.install_shop_with_modules.custom_script_container 4 }}{{ end }} + skip_shop_installation: '{{ if .Data.install.skip_shop_installation }}{{ .Data.install.skip_shop_installation }}{{ else }}{{ .Data.install_shop_with_modules.skip_shop_installation }}{{ end }}' + output: + files: | + {{ if .Data.install.output.files }}{{ indent .Data.install.output.files 6 }}{{ else }}{{ indent .Data.install_shop_with_modules.output.files 6 }}{{ end }} + # The configuration file name is dynamic, the matrix variables will be appended + artifact_prefix: 'install' diff --git a/.github/oxid-esales/defaults/component.yaml.backup b/.github/oxid-esales/defaults/component.yaml.backup new file mode 100644 index 00000000..e123923c --- /dev/null +++ b/.github/oxid-esales/defaults/component.yaml.backup @@ -0,0 +1,46 @@ +install_shop_with_modules: + method: legacy + cache: + prepared_shop: false + git: + # Deprecated, remove in v5 + shop_url: 'https://github.com/{{ .Data.global.repo }}.git' + # Deprecated, remove in v5 + shop_ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}' + repository: '{{ .Data.global.repo }}' + ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}' + composer: + root_url: '' + transform: '' + skip_shop_installation: true + output: + files: | + docker-compose.yml + source/composer.json* + source/composer.lock + source/source/config.inc.php + source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php + data/php/logs/error_log.txt + files.txt + +runscript: &runscript + component: + path: '' + deprecated: + path: '' + composer: + transform: | + { + "require-dev": { + "oxid-esales/testing-library": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.dev_ref }}", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + +runslim: + <<: *runscript + +finish: + slack_title: '{{ print .Data.global.name}} ({{ .Data.global.git.safe_ref_name }}) by {{ .Github.Actor }}' diff --git a/.github/oxid-esales/defaults/component.yml.backup b/.github/oxid-esales/defaults/component.yml.backup new file mode 100644 index 00000000..e123923c --- /dev/null +++ b/.github/oxid-esales/defaults/component.yml.backup @@ -0,0 +1,46 @@ +install_shop_with_modules: + method: legacy + cache: + prepared_shop: false + git: + # Deprecated, remove in v5 + shop_url: 'https://github.com/{{ .Data.global.repo }}.git' + # Deprecated, remove in v5 + shop_ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}' + repository: '{{ .Data.global.repo }}' + ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}' + composer: + root_url: '' + transform: '' + skip_shop_installation: true + output: + files: | + docker-compose.yml + source/composer.json* + source/composer.lock + source/source/config.inc.php + source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php + data/php/logs/error_log.txt + files.txt + +runscript: &runscript + component: + path: '' + deprecated: + path: '' + composer: + transform: | + { + "require-dev": { + "oxid-esales/testing-library": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/tests-deprecated-ce": "{{ .Data.global.composer.dev_ref }}", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + +runslim: + <<: *runscript + +finish: + slack_title: '{{ print .Data.global.name}} ({{ .Data.global.git.safe_ref_name }}) by {{ .Github.Actor }}' diff --git a/.github/oxid-esales/defaults/defaults.yaml.backup b/.github/oxid-esales/defaults/defaults.yaml.backup new file mode 100644 index 00000000..79ed3e25 --- /dev/null +++ b/.github/oxid-esales/defaults/defaults.yaml.backup @@ -0,0 +1,842 @@ +# Purpose +# ======= +# This file defines the default settings for the test workflow. It contains all +# variables. The variables can then be overridden in more specific yaml files +# to run different test scenarios. +# +# Variables used in multiple steps will be defined in the "workflow" and "global" +# sections and we use anchors to reference them in the specific sections. We use +# yamllint to validate the files, make sure to add linter exceptions, when you +# break the rules. +# +# We can use Golang templates in these test plans, see https://github.com/joernott/load_testplan/blob/main/README.md +# on how to reference environment variables and the github context. +# +# Sections +# ======== +# The yaml hierarchy will be flattened to simple key=value settings. The +# various levels of the yaml file here will become prefixes to the variable +# names. For each step of the testplan, we use use a section to have the +# variables for that step contain the same prefix. +# +# The "workflow" section contains global definitions of matrix variables and +# settings used in the "strategy" parts of a job. They have anchors and every +# specific job has its own variables which reference these anchors if no +# job specific exceptions are needed. +# +# The "global" section is much the same. The variables here are defaults with +# anchors which will be used inside the steps of the various other sections. +# + +# Global settings for a jobs strategy setting +workflow: + + # The variables "php" and "mysql" in the "matrix" subsection are used to run + # a matrix of all combinations of these values for testing. + matrix: &matrix + # This string contains a json array of php versions to test against. + php: &matrix_php '["8.2","8.3"]' + + # This json array are the mysql versions to test + mysql: &matrix_mysql '["5.7","8.0.36"]' + + # This matrix definition is used, when we only want one analysis done + # It covers the recommended combination of PHP and MySQL + matrix_slim: &matrix_slim + php: &matrix_php_slim '["8.2"]' + mysql: &matrix_mysql_slim '["8.0.36"]' + + # How many matrix tests should run in parallel. When running on our private runners, we need to + # reduce this to get consistent test results + max_parallel: &max_parallel 4 + +# Global settings used in the actual steps in the jobs +global: + # The title of the workflow is used to distinguish multiple runs of the workflow triggered + # from one single trigger, e.g. a scheduled run + title: '{{ .Github.EventName }}-{{ .Github.RefName }}' + + # This action can be used on the community edition (ce) and enterprise + # edition (ee) of the shop. On top of setting this to true, a few extra + # variables/secrets must be provided for using the action on ee. + # If is enterprise is set to true, you need to provide the following + # - secrets.enterprise_github_token + # - testplan entry global.git_enterprise_ref + is_enterprise: &is_enterprise false + # This template variable must be set to "ce" if is_enterprise is false or "ee" + # if is_enterprise is true. It will be used for determining object names + # {{ $shop_type := "ce" }}$shop_type: {{ printf "%q" $shop_type }} + + # Repository related settings + git: &git + + # URL for the docker-eshop sdk repository to clone + sdk_url: &git_sdk_url 'https://github.com/OXID-eSales/docker-eshop-sdk.git' + + # Branch to check out for the SDK + sdk_ref: &git_sdk_ref 'master' + + # URL for the oxidshop_ce repository + shop_url: &git_shop_url 'https://github.com/OXID-eSales/oxideshop_ce.git' + + # Branch, tag or hash of the commit to check out + shop_ref: &git_shop_ref '{{ .Github.RefName }}' + + # URL for the oxidshop_pe repository + enterprise_url: 'https://github.com/OXID-eSales/oxideshop_ee.git' + + # Branch to check out for the enterprise repos + enterprise_ref: &git_enterprise_ref 'b-8.0.x' + + # Branch to check out for modules/plugins etc + default_ref: &default_ref 'b-8.0.x' + + # When running on a self hosted runner with access to a local s3 cache: + # Set the following secrets: + # - secrets.CACHE_ENDPOINT + # - secrets.CACHE_ACCESS_KEY + # - secrets.CACHE_SECRET_KEY + cache: &cache + bucket: &cache_bucket 'oxideshop-ee' + + # Should we log in to docker? If set to "true", you need to set the following + # secrets: + # - secrets.DOCKER_HUB_USER + # - secrets.DOCKER_HUB_TOKEN + docker_login: &docker_login true + + # Settings related to the container we run tests in + container: &container + + # Name of the container running php + name: &container_name 'php' + + # Additional options passed to docker compose when running tests in + # the the container + options: &container_options '' + + # Method to execute the commands inside a container. + # "run" spins up an entirely new container while "exec" runs inside the + # already running container. + method: &container_method 'exec' + + # These defaults are used when running the composer_configure and + # composer_require actions + composer: &composer + # This is just a definition we can apply in later configs + # It will be overwritten by the 7.0.x and 7.1.x templates + # and can be used by referencing .Data.global.composer.dev_ref + dev_ref: &dev_ref dev-b-8.0.x + + # Use these settings below to merge a json configuration with an existing + # composer.json + + # Path to the composer.json folder on the runner (source/composer.json, + # not /var/www/composer.json) + file: 'source/composer.json' + + # Should a backup of the original composer.json be created? + backup: true + + # Merge this json data with composer.json. If this is empty, + # no transformation will be applied + transform: '' + + # Should we run composer update + update: true + + # Options for composer update + update_options: '--no-interaction' + + # This grep pattern is applied to the generated phpunit, codeception and runtest log file. If we have + # a hit matching the pattern below, the step will fail. + failure_pattern: &failure_pattern | + 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]* + +# The init phase handles loading the testplans and creating report artifacts for the run +init: + cache: + bucket: *cache_bucket + name: '{{ .Github.EventName }}-{{ .Github.RefName }}-testplan-{{ .Env.GITHUB_REPOSITORY_ID }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# The prepare_shop step checks out the sdk and the shop. It is a prerequisite +# for the install_shop and shop_setup tests. It generates a cached object +# used in those steps. +# See docs/actions/prepare_shop.md for more information on the custom action. +prepare_shop: &prepare_shop + matrix: *matrix + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + git: *git + cache: + bucket: *cache_bucket + prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + composer: + <<: *composer + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-8.0.x", + "oxid-esales/twig-admin-theme": "dev-b-8.0.x", + "oxid-esales/apex-theme": "dev-b-8.0.x" + } + } + + # These modify php "custom.ini" + custom_ini: + # Error reporting settings + error_reporting: 'E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING' + + # xdebug settings for php custom.ini + xdebug: 'xdebug.max_nesting_level=1000' + + # Space separated list of extra services to add + add_services: 'selenium-chrome-126' + +# This is the second part of the shop installation. It uses the cached +# shop from prepare_shop and generates its own cached object used in the +# following steps. See docs/actions/start_shop.md and +# docs/actions/install_shop.md for more information on the custom actions. +install_shop: + matrix: *matrix + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + is_enterprise: *is_enterprise + cache: + bucket: *cache_bucket + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + + # Modifying source/source/config.inc.php + config: &install_config + # Set iDebug in source/source/config.inc.php + idebug: false + # Run custom script outside the container + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:setup:demodata' + custom_script_container: '' + + # Exporting an artifact with Configuration files for the shop setup + output: &install_output + files: | + docker-compose.yml + docker*.log + source/composer.json* + source/composer.lock + source/source/config.inc.php + data/php/logs/error_log.txt + files.txt + # The configuration file name is dynamic, the matrix variables will be appended + artifact_prefix: 'configs_install_shop' + +# This section here is for compatibility reasons with the _rename template +install_shop_with_modules: + <<: *prepare_shop + is_enterprise: *is_enterprise + config: *install_config + custom_script: '' + custom_script_container: '' + output: *install_output + +# This installs a single module for testing. If no module is defined, you need +# to ensure that the cache_prefix for this step is identical to the cache_prefix +# from install_shop +# steps will use the chached object from install_shop +# See docs/actions/start_shop.md and docs/actions/install_module.md for more information. +install_module: + matrix: + php: *matrix_php + mysql: *matrix_mysql + testplan: '["skip"]' + max_parallel: *max_parallel + docker_login: *docker_login + load_shop: *install_shop_prefix + container: *container + container_options: *container_options + container_method: *container_method + composer: *composer + cache: + bucket: *cache_bucket + # If we don't install a module, keep it the same as the prefix for + # installed_shop. Otherwise set it to + # 'moduleInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: &install_module_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + output: + files: | + docker-compose.yml + docker*.log + source/composer.json* + source/composer.lock + source/source/config.inc.php + files.txt + generated_testplan.yaml + artifact_prefix: 'configs-install_module' + # Unique module id + ids: &module_ids '' + + # Title is used in the reports and debugging, if we install multiple modules + # debugging relies on sorting by titles, so prefixing it with numbers is + # recommended + title: *module_ids + + # Git repository related settings + git: + module: + # URL for the module repository + url: '' + + # Branch to check out/test + ref: *default_ref + + # Name of the package on github (organization/repository) + package_name: '' + + # Path to install the module under dev-packages, should be the same as module_ids + path: &module_path '' + + # What modules should be activated + activate: *module_ids + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + +# The unit tests we run on our code, this uses phpunit for the actual tests. +# See docs/actions/start_shop.md and docs/actions/phpunit.md for more information. +phpunit: + matrix: + php: *matrix_php + mysql: *matrix_mysql + + # Providing a list of testplans to be executed with phpunit + # by default, these are the unit and integration tests + testplan: '["~/phpunit_unit.yml","~/phpunit_integration.yml"]' + max_parallel: 8 + # The title is used in the matrix testplan runs to distinguish their output + # Overwrite it with a unique name in each iteration + title: 'phpunit_unit' + docker_login: *docker_login + # Which cached shop do we want to load. + load_shop: *install_module_prefix + container: *container + cache: *cache + composer: *composer + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # Name of the configuration file + configuration: 'phpunit.xml' + # Name of the test or folder to run + test: '' + # Optional: Additional options to pass to phpunit + additional_options: '' + + # log file related settings + logfile: + + # The name of the output logfile starts with this. The rest is dynamic, + # using the PHP and MySQL matrix parameters. So it will be something like + # '_PHP_MYSQL.txt' + prefix: 'phpunit' + + # Output artifact for this step + output: + # Which files should be archived + files: | + docker*.log + source/source/log/oxideshop.log + data/php/logs/error_log.txt + job_status*.txt + generated_testplan.yaml + + # Github run artifact for the phpunit output - This is dynamic, so we set it + # in the workflow to '_MYSQL' + prefix: 'phpunit_artifacts' + + # Settings for the coverage report + coverage: + # Name of the file produced in the coverage report. This must match + # the value of '--coverage-clover' in the additional_options above. + # If the name is empty, nothing will be added to the coverage reports + # artifact. + path: '' + + # Github run artifact for the coverage file - This is dynamic, so we set it + # in the workflow to _PHP_MYSQL. + # Currently, we put all log files across all steps into one artifact per + # matrix combination. + prefix: coverage-reports-phpunit + + failure_pattern: *failure_pattern + +# This step usesd the codeception custom action. Many inputs are similar to the +# ones in the unit tests. +# See docs/actions/start_shop.md and docs/actions/codeception.md for more information. +codeception: + matrix: + php: *matrix_php + mysql: *matrix_mysql + + # Providing a list of testplans to be executed with codeception + # by default, these are the regular Acceptance and shop setup tests + testplan: '["~/codeception_Acceptance.yml","~/codeception_AcceptanceSetup.yml"]' + + # More parallelism causes instability on the private runners, so we reduce it here + max_parallel: &codeception_max_parallel 1 + docker_login: *docker_login + load_shop: *install_module_prefix + + # Should we wait until selenium is running + wait_for_selenium: true + + container: + <<: *container + + # For codeception, we need different options than the empty default + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome' + + cache: *cache + composer: *composer + + # This script is used to determine container options depending on the module and + # modifying the codeception config to handle smarty. You must create the + # "container_options" output here + pre_script: | + MODULE_OPTIONS="" + if [ "${install_module_ids}" != "" ]; then + MODULE_OPTIONS="-e MODULE_IDS=${install_module_ids}" + fi + echo "CODECEPTION_CONTAINER_OPTIONS=-e THEME_ID=apex ${MODULE_OPTIONS}" | tee -a "${GITHUB_ENV}" + echo "container_options=-e THEME_ID=apex ${MODULE_OPTIONS}" | tee -a "${GITHUB_OUTPUT}" + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + configuration: 'tests/codeception.yml' + + # Whether to run the codeception build step before running codeception itself + build: true + + # Name of the codeception test suite to run + suite: 'Acceptance' + + # Name of the test to run + test: '' + + # Additional options to pass to codeception + additional_options: '--ext DotReporter' + + # Additional options to pass to codecept build + build_additional_options: '' + + logfile: + prefix: 'codeception' + + output: + files: | + docker-compose.yml + docker*.log + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/tests/Codeception/_output + job_status*.txt + generated_testplan.yaml + prefix: 'codeception_artifacts' + + coverage: + # Must math the value of --coverage-xml in 'additional_options'. If empty, + # nothing will be added to the codeception artifact + path: '' + prefix: coverage-reports-codeception + failure_pattern: *failure_pattern + +# These deprecated tests use the runtests action. Many options are similar to +# codeception/phpunit +runtest: + matrix: + php: *matrix_php + mysql: *matrix_mysql + + # Providing a list of testplans to be executed with runtests + # by default, these are the deprecated tests + testplan: '["~/deprecated_tests.yml"]' + max_parallel: *max_parallel + docker_login: *docker_login + load_shop: *install_module_prefix + container: + <<: *container + options: '-e XDEBUG_MODE=coverage' + cache: *cache + title: 'deprecated_tests' + composer: + <<: *composer + transform: | + { + "require-dev": { + "oxid-esales/testing-library": "dev-b-8.0.x", + "oxid-esales/tests-deprecated-ce": "dev-b-8.0.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # Name of the config file to copy + config_file: 'vendor/oxid-esales/testing-library/test_config.yml.dist' + + # Should we run reset-shop + reset_shop: true + + test: 'AllTestsUnit' + additional_options: '--coverage-clover=/var/www/coverage_deprecated_tests.xml' + logfile: + prefix: 'runtests' + + output: + files: | + docker*.log + source/unit.cov + source/source/log/oxideshop.log + source/test_config.yml + data/php/logs/error_log.txt + prefix: 'deprecated_tests_artifacts' + coverage: + path: 'source/coverage_deprecated_tests.xml' + prefix: coverage-reports-runtest + failure_pattern: *failure_pattern + + # Where to find the reset-shop binary + reset_shop_binary: 'vendor/bin/reset-shop' + + # Where to find the runtests binary + runtests_binary: 'vendor/bin/runtests' + +# Running the sonarcloud scanner on the gathered coverage reports +sonarcloud: + # We only run sonarcloud for one of the matrix combinations of PHP/MySQL + matrix: + php: '["8.1"]' + mysql: '["5.7"]' + testplan: '["-"]' + + # There is only one matrix combination + max_parallel: 1 + docker_login: *docker_login + + # You only need to change the title when running multiple sonarcloud scans in one workflow + title: 'sonarcloud' + + # By default, the current repository and the current branch are checked out. When running the + # workflow in a different repository, we need to change this + git: + repository: '' + ref: '' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + coverage: + prefix: coverage-report + target_branch: b-8.0.x + + # Part of the absolute path to strip from the paths inside the coverage.xml, + # This ist /var/www/ (note the trailing slash) fort the shop and should be set to + # /var/www/dev-packages// for modules + strip_path: '/var/www/' + + # Sonarcloud settings, get them from https://sonarcloud.io/organizations/oxid-esales/projects + organization: 'oxid-esales' + project_key: 'OXID-eSales_oxideshop_ce' + project_name: 'oxideshop_ce' + # Parameters passed to the scanner + parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=source + -Dsonar.tests=tests + + # DEPRECATED: (we use a separate config for this now) for the internal run, leave the project key empty if you don't have a need + # for this second run with different settings + internal_project_key: 'OXID-eSales_oxideshop_ce_internal' + internal_project_name: 'oxideshop_ce_internal' + internal_parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=source/Internal + -Dsonar.tests=tests + +# See docs/actions/start_shop.md and docs/actions/phpcs.md for more information. +phpcs_tests: + skip: false + matrix: *matrix_slim + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + cache: + bucket: *cache_bucket + # Name of the branch/commit to gather the list of changed files + git: + ref: '{{ .Github.Ref }}' + # Should we use git diff or check all files + diff_only: true + # Filter the file n ames against this regex + filter: '\.php$' + # Optional: Additional options to pass to phpcs + additional_options: '-vp --standard=PSR12' + output: + files: | + data/php/logs/error_log.txt + prefix: 'phpcs-artifacts' + # Grep pattern which indicate that the test failed + failure_pattern: '[1-9][0-9]* error|[1-9][0-9]* warning' + +# See docs/actions/start_shop.md and docs/actions/phpmd.md for more information. +phpmd: + matrix: + php: *matrix_php_slim + mysql: *matrix_mysql_slim + # This is only used in the module workflow, so the default is to skip this + testplan: 'skip' + max_parallel: 8 + + # This is the name of the report and code artifact, you need to override it if you want + # to generate reports for multiple modules in one workflow + title: 'oxideshop_ce' + + load_shop: *install_module_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + file: 'source/composer.json' + backup: true + # Make sure, phpmd is installed properly + transform: | + { + "require-dev": { + "phpmd/phpmd": "@stable" + } + } + update: true + update_options: '--no-interaction' + + # Name of the source folder, relative to the path above. That is source for the shop + # and src for modules. + source_path: 'source/' + + # This is the folder we store the reports in (relative to /var/www in the container) + report_path: 'reports' + + # Path to the phpmd configuration file + config: 'tests/PhpMd/standard.xml' + + # Path to a phpmd baseline file + baseline_file: 'tests/PhpMd/phpmd.baseline.xml' + + # Additional options to pass to phpmd + additional_options: '' + + # If set to true, the report will run an additional composer phpmd to output into the github actions log + verbose: true + + # If set to true, the report will run phpstan to generate a new baseline file + generate_baseline: true + + output: + prefix: 'styles-phpmd' + + failure_pattern: &failure_pattern | + "warnings": + "violations": + "errors": + +phpstan: + matrix: + php: *matrix_php_slim + mysql: *matrix_mysql_slim + # This is only used in the module workflow, so the default is to skip this + testplan: 'skip' + max_parallel: 8 + + # This is the name of the report and code artifact, you need to override it if you want + # to generate reports for multiple modules in one workflow + title: 'oxideshop_ce' + + load_shop: *install_module_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + file: 'source/composer.json' + backup: true + # Make sure, phpmd is installed properly + transform: | + { + "preferred-install": { + "phpstan/phpstan": "dist" + }, + "require": { + "phpstan/phpstan": "^1.10" + } + } + update: true + update_options: '--no-interaction' + + # Name of the source folder, relative to the path above. That is source for the shop + # and src for modules. + source_path: 'source' + + # This is the folder we store the reports in (relative to /var/www in the container) + report_path: 'reports' + + # Path to the phpstan configuration file + neon_file: 'tests/PhpStan/phpstan.neon' + + # Additional options to pass to phpmd + additional_options: '--no-progress' + + # If set to true, the report will run phpstan a 2nd time to output into the github actions log + verbose: true + + # If set to true, the report will run phpstan to generate a new baseline file + generate_baseline: true + + output: + prefix: 'styles-phpstan' + + failure_pattern: &failure_pattern | + "errors":[1-9][0-9]* + "file_errors":[1-9][0-9]* + +styles: + matrix: + php: *matrix_php_slim + mysql: *matrix_mysql_slim + # This is only used in the module workflow, so the default is to skip this + testplan: 'skip' + max_parallel: 1 + # When looping over multiple modules, title must be set for every element + title: 'styles' + docker_login: *docker_login + load_shop: *install_module_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + file: 'source/dev-packages/test-module/composer.json' + backup: true + transform: '' + update: true + update_options: '--no-interaction' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # The path pointing to the module relative to source/dev-packages needs to be the same as in install_module + path: *module_path + + # The module_ids needs to be the same as in install_module + module_ids: *module_ids + + # These options are passed along to composer install + install_options: '' + + # Each iteration of the styles workflow will move their report to a distinct name in the central report folder + output: + files: | + source/tests/reports/phpstan*.report.json + source/tests/reports/phpmd*.report.json + source/tests/reports/phpcs*.report.json + source/tests/reports/phpstan*.report.txt + source/tests/reports/phpmd*.report.txt + source/tests/reports/phpcs*.report.txt + data/php/logs/error_log.txt + prefix: 'styles_artifacts' + +# yamllint validates the github actions/testplan yaml files +yamllint: + # Skip this part of the test run + skip: false + + # Rules for the linter + rules: | + extends: default + ignore: .git/* + rules: + document-start: disable + line-length: + max: 160 + level: warning + new-line-at-end-of-file: + level: warning + trailing-spaces: + level: warning + truthy: disable + + # Space separated list of files or directories + file_or_dir: '.github' + +# actionlint validates the github actions workflows (not actions) +actionlint: + # Skip this part of the test run + skip: false + +# This is the final cleanup at the end +finish: + # Skip this part of the test run + skip: false + # Using the global settings here + matrix: + php: *matrix_php + mysql: *matrix_mysql + # This is used as a title for slack notifications + slack_title: '{{ .Github.Workflow }} ({{ .Github.RefName }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' + # Should we use the compact slack format onstead of the long one? + slack_compact: true diff --git a/.github/oxid-esales/defaults/defaults.yml.backup b/.github/oxid-esales/defaults/defaults.yml.backup new file mode 100644 index 00000000..79ed3e25 --- /dev/null +++ b/.github/oxid-esales/defaults/defaults.yml.backup @@ -0,0 +1,842 @@ +# Purpose +# ======= +# This file defines the default settings for the test workflow. It contains all +# variables. The variables can then be overridden in more specific yaml files +# to run different test scenarios. +# +# Variables used in multiple steps will be defined in the "workflow" and "global" +# sections and we use anchors to reference them in the specific sections. We use +# yamllint to validate the files, make sure to add linter exceptions, when you +# break the rules. +# +# We can use Golang templates in these test plans, see https://github.com/joernott/load_testplan/blob/main/README.md +# on how to reference environment variables and the github context. +# +# Sections +# ======== +# The yaml hierarchy will be flattened to simple key=value settings. The +# various levels of the yaml file here will become prefixes to the variable +# names. For each step of the testplan, we use use a section to have the +# variables for that step contain the same prefix. +# +# The "workflow" section contains global definitions of matrix variables and +# settings used in the "strategy" parts of a job. They have anchors and every +# specific job has its own variables which reference these anchors if no +# job specific exceptions are needed. +# +# The "global" section is much the same. The variables here are defaults with +# anchors which will be used inside the steps of the various other sections. +# + +# Global settings for a jobs strategy setting +workflow: + + # The variables "php" and "mysql" in the "matrix" subsection are used to run + # a matrix of all combinations of these values for testing. + matrix: &matrix + # This string contains a json array of php versions to test against. + php: &matrix_php '["8.2","8.3"]' + + # This json array are the mysql versions to test + mysql: &matrix_mysql '["5.7","8.0.36"]' + + # This matrix definition is used, when we only want one analysis done + # It covers the recommended combination of PHP and MySQL + matrix_slim: &matrix_slim + php: &matrix_php_slim '["8.2"]' + mysql: &matrix_mysql_slim '["8.0.36"]' + + # How many matrix tests should run in parallel. When running on our private runners, we need to + # reduce this to get consistent test results + max_parallel: &max_parallel 4 + +# Global settings used in the actual steps in the jobs +global: + # The title of the workflow is used to distinguish multiple runs of the workflow triggered + # from one single trigger, e.g. a scheduled run + title: '{{ .Github.EventName }}-{{ .Github.RefName }}' + + # This action can be used on the community edition (ce) and enterprise + # edition (ee) of the shop. On top of setting this to true, a few extra + # variables/secrets must be provided for using the action on ee. + # If is enterprise is set to true, you need to provide the following + # - secrets.enterprise_github_token + # - testplan entry global.git_enterprise_ref + is_enterprise: &is_enterprise false + # This template variable must be set to "ce" if is_enterprise is false or "ee" + # if is_enterprise is true. It will be used for determining object names + # {{ $shop_type := "ce" }}$shop_type: {{ printf "%q" $shop_type }} + + # Repository related settings + git: &git + + # URL for the docker-eshop sdk repository to clone + sdk_url: &git_sdk_url 'https://github.com/OXID-eSales/docker-eshop-sdk.git' + + # Branch to check out for the SDK + sdk_ref: &git_sdk_ref 'master' + + # URL for the oxidshop_ce repository + shop_url: &git_shop_url 'https://github.com/OXID-eSales/oxideshop_ce.git' + + # Branch, tag or hash of the commit to check out + shop_ref: &git_shop_ref '{{ .Github.RefName }}' + + # URL for the oxidshop_pe repository + enterprise_url: 'https://github.com/OXID-eSales/oxideshop_ee.git' + + # Branch to check out for the enterprise repos + enterprise_ref: &git_enterprise_ref 'b-8.0.x' + + # Branch to check out for modules/plugins etc + default_ref: &default_ref 'b-8.0.x' + + # When running on a self hosted runner with access to a local s3 cache: + # Set the following secrets: + # - secrets.CACHE_ENDPOINT + # - secrets.CACHE_ACCESS_KEY + # - secrets.CACHE_SECRET_KEY + cache: &cache + bucket: &cache_bucket 'oxideshop-ee' + + # Should we log in to docker? If set to "true", you need to set the following + # secrets: + # - secrets.DOCKER_HUB_USER + # - secrets.DOCKER_HUB_TOKEN + docker_login: &docker_login true + + # Settings related to the container we run tests in + container: &container + + # Name of the container running php + name: &container_name 'php' + + # Additional options passed to docker compose when running tests in + # the the container + options: &container_options '' + + # Method to execute the commands inside a container. + # "run" spins up an entirely new container while "exec" runs inside the + # already running container. + method: &container_method 'exec' + + # These defaults are used when running the composer_configure and + # composer_require actions + composer: &composer + # This is just a definition we can apply in later configs + # It will be overwritten by the 7.0.x and 7.1.x templates + # and can be used by referencing .Data.global.composer.dev_ref + dev_ref: &dev_ref dev-b-8.0.x + + # Use these settings below to merge a json configuration with an existing + # composer.json + + # Path to the composer.json folder on the runner (source/composer.json, + # not /var/www/composer.json) + file: 'source/composer.json' + + # Should a backup of the original composer.json be created? + backup: true + + # Merge this json data with composer.json. If this is empty, + # no transformation will be applied + transform: '' + + # Should we run composer update + update: true + + # Options for composer update + update_options: '--no-interaction' + + # This grep pattern is applied to the generated phpunit, codeception and runtest log file. If we have + # a hit matching the pattern below, the step will fail. + failure_pattern: &failure_pattern | + 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]* + +# The init phase handles loading the testplans and creating report artifacts for the run +init: + cache: + bucket: *cache_bucket + name: '{{ .Github.EventName }}-{{ .Github.RefName }}-testplan-{{ .Env.GITHUB_REPOSITORY_ID }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# The prepare_shop step checks out the sdk and the shop. It is a prerequisite +# for the install_shop and shop_setup tests. It generates a cached object +# used in those steps. +# See docs/actions/prepare_shop.md for more information on the custom action. +prepare_shop: &prepare_shop + matrix: *matrix + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + git: *git + cache: + bucket: *cache_bucket + prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + composer: + <<: *composer + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-8.0.x", + "oxid-esales/twig-admin-theme": "dev-b-8.0.x", + "oxid-esales/apex-theme": "dev-b-8.0.x" + } + } + + # These modify php "custom.ini" + custom_ini: + # Error reporting settings + error_reporting: 'E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING' + + # xdebug settings for php custom.ini + xdebug: 'xdebug.max_nesting_level=1000' + + # Space separated list of extra services to add + add_services: 'selenium-chrome-126' + +# This is the second part of the shop installation. It uses the cached +# shop from prepare_shop and generates its own cached object used in the +# following steps. See docs/actions/start_shop.md and +# docs/actions/install_shop.md for more information on the custom actions. +install_shop: + matrix: *matrix + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + is_enterprise: *is_enterprise + cache: + bucket: *cache_bucket + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + + # Modifying source/source/config.inc.php + config: &install_config + # Set iDebug in source/source/config.inc.php + idebug: false + # Run custom script outside the container + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:setup:demodata' + custom_script_container: '' + + # Exporting an artifact with Configuration files for the shop setup + output: &install_output + files: | + docker-compose.yml + docker*.log + source/composer.json* + source/composer.lock + source/source/config.inc.php + data/php/logs/error_log.txt + files.txt + # The configuration file name is dynamic, the matrix variables will be appended + artifact_prefix: 'configs_install_shop' + +# This section here is for compatibility reasons with the _rename template +install_shop_with_modules: + <<: *prepare_shop + is_enterprise: *is_enterprise + config: *install_config + custom_script: '' + custom_script_container: '' + output: *install_output + +# This installs a single module for testing. If no module is defined, you need +# to ensure that the cache_prefix for this step is identical to the cache_prefix +# from install_shop +# steps will use the chached object from install_shop +# See docs/actions/start_shop.md and docs/actions/install_module.md for more information. +install_module: + matrix: + php: *matrix_php + mysql: *matrix_mysql + testplan: '["skip"]' + max_parallel: *max_parallel + docker_login: *docker_login + load_shop: *install_shop_prefix + container: *container + container_options: *container_options + container_method: *container_method + composer: *composer + cache: + bucket: *cache_bucket + # If we don't install a module, keep it the same as the prefix for + # installed_shop. Otherwise set it to + # 'moduleInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: &install_module_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + output: + files: | + docker-compose.yml + docker*.log + source/composer.json* + source/composer.lock + source/source/config.inc.php + files.txt + generated_testplan.yaml + artifact_prefix: 'configs-install_module' + # Unique module id + ids: &module_ids '' + + # Title is used in the reports and debugging, if we install multiple modules + # debugging relies on sorting by titles, so prefixing it with numbers is + # recommended + title: *module_ids + + # Git repository related settings + git: + module: + # URL for the module repository + url: '' + + # Branch to check out/test + ref: *default_ref + + # Name of the package on github (organization/repository) + package_name: '' + + # Path to install the module under dev-packages, should be the same as module_ids + path: &module_path '' + + # What modules should be activated + activate: *module_ids + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + +# The unit tests we run on our code, this uses phpunit for the actual tests. +# See docs/actions/start_shop.md and docs/actions/phpunit.md for more information. +phpunit: + matrix: + php: *matrix_php + mysql: *matrix_mysql + + # Providing a list of testplans to be executed with phpunit + # by default, these are the unit and integration tests + testplan: '["~/phpunit_unit.yml","~/phpunit_integration.yml"]' + max_parallel: 8 + # The title is used in the matrix testplan runs to distinguish their output + # Overwrite it with a unique name in each iteration + title: 'phpunit_unit' + docker_login: *docker_login + # Which cached shop do we want to load. + load_shop: *install_module_prefix + container: *container + cache: *cache + composer: *composer + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # Name of the configuration file + configuration: 'phpunit.xml' + # Name of the test or folder to run + test: '' + # Optional: Additional options to pass to phpunit + additional_options: '' + + # log file related settings + logfile: + + # The name of the output logfile starts with this. The rest is dynamic, + # using the PHP and MySQL matrix parameters. So it will be something like + # '_PHP_MYSQL.txt' + prefix: 'phpunit' + + # Output artifact for this step + output: + # Which files should be archived + files: | + docker*.log + source/source/log/oxideshop.log + data/php/logs/error_log.txt + job_status*.txt + generated_testplan.yaml + + # Github run artifact for the phpunit output - This is dynamic, so we set it + # in the workflow to '_MYSQL' + prefix: 'phpunit_artifacts' + + # Settings for the coverage report + coverage: + # Name of the file produced in the coverage report. This must match + # the value of '--coverage-clover' in the additional_options above. + # If the name is empty, nothing will be added to the coverage reports + # artifact. + path: '' + + # Github run artifact for the coverage file - This is dynamic, so we set it + # in the workflow to _PHP_MYSQL. + # Currently, we put all log files across all steps into one artifact per + # matrix combination. + prefix: coverage-reports-phpunit + + failure_pattern: *failure_pattern + +# This step usesd the codeception custom action. Many inputs are similar to the +# ones in the unit tests. +# See docs/actions/start_shop.md and docs/actions/codeception.md for more information. +codeception: + matrix: + php: *matrix_php + mysql: *matrix_mysql + + # Providing a list of testplans to be executed with codeception + # by default, these are the regular Acceptance and shop setup tests + testplan: '["~/codeception_Acceptance.yml","~/codeception_AcceptanceSetup.yml"]' + + # More parallelism causes instability on the private runners, so we reduce it here + max_parallel: &codeception_max_parallel 1 + docker_login: *docker_login + load_shop: *install_module_prefix + + # Should we wait until selenium is running + wait_for_selenium: true + + container: + <<: *container + + # For codeception, we need different options than the empty default + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome' + + cache: *cache + composer: *composer + + # This script is used to determine container options depending on the module and + # modifying the codeception config to handle smarty. You must create the + # "container_options" output here + pre_script: | + MODULE_OPTIONS="" + if [ "${install_module_ids}" != "" ]; then + MODULE_OPTIONS="-e MODULE_IDS=${install_module_ids}" + fi + echo "CODECEPTION_CONTAINER_OPTIONS=-e THEME_ID=apex ${MODULE_OPTIONS}" | tee -a "${GITHUB_ENV}" + echo "container_options=-e THEME_ID=apex ${MODULE_OPTIONS}" | tee -a "${GITHUB_OUTPUT}" + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + configuration: 'tests/codeception.yml' + + # Whether to run the codeception build step before running codeception itself + build: true + + # Name of the codeception test suite to run + suite: 'Acceptance' + + # Name of the test to run + test: '' + + # Additional options to pass to codeception + additional_options: '--ext DotReporter' + + # Additional options to pass to codecept build + build_additional_options: '' + + logfile: + prefix: 'codeception' + + output: + files: | + docker-compose.yml + docker*.log + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/tests/Codeception/_output + job_status*.txt + generated_testplan.yaml + prefix: 'codeception_artifacts' + + coverage: + # Must math the value of --coverage-xml in 'additional_options'. If empty, + # nothing will be added to the codeception artifact + path: '' + prefix: coverage-reports-codeception + failure_pattern: *failure_pattern + +# These deprecated tests use the runtests action. Many options are similar to +# codeception/phpunit +runtest: + matrix: + php: *matrix_php + mysql: *matrix_mysql + + # Providing a list of testplans to be executed with runtests + # by default, these are the deprecated tests + testplan: '["~/deprecated_tests.yml"]' + max_parallel: *max_parallel + docker_login: *docker_login + load_shop: *install_module_prefix + container: + <<: *container + options: '-e XDEBUG_MODE=coverage' + cache: *cache + title: 'deprecated_tests' + composer: + <<: *composer + transform: | + { + "require-dev": { + "oxid-esales/testing-library": "dev-b-8.0.x", + "oxid-esales/tests-deprecated-ce": "dev-b-8.0.x", + "codeception/module-webdriver": "^3.1", + "phpunit/phpunit": "^9.1.1" + } + } + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # Name of the config file to copy + config_file: 'vendor/oxid-esales/testing-library/test_config.yml.dist' + + # Should we run reset-shop + reset_shop: true + + test: 'AllTestsUnit' + additional_options: '--coverage-clover=/var/www/coverage_deprecated_tests.xml' + logfile: + prefix: 'runtests' + + output: + files: | + docker*.log + source/unit.cov + source/source/log/oxideshop.log + source/test_config.yml + data/php/logs/error_log.txt + prefix: 'deprecated_tests_artifacts' + coverage: + path: 'source/coverage_deprecated_tests.xml' + prefix: coverage-reports-runtest + failure_pattern: *failure_pattern + + # Where to find the reset-shop binary + reset_shop_binary: 'vendor/bin/reset-shop' + + # Where to find the runtests binary + runtests_binary: 'vendor/bin/runtests' + +# Running the sonarcloud scanner on the gathered coverage reports +sonarcloud: + # We only run sonarcloud for one of the matrix combinations of PHP/MySQL + matrix: + php: '["8.1"]' + mysql: '["5.7"]' + testplan: '["-"]' + + # There is only one matrix combination + max_parallel: 1 + docker_login: *docker_login + + # You only need to change the title when running multiple sonarcloud scans in one workflow + title: 'sonarcloud' + + # By default, the current repository and the current branch are checked out. When running the + # workflow in a different repository, we need to change this + git: + repository: '' + ref: '' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + coverage: + prefix: coverage-report + target_branch: b-8.0.x + + # Part of the absolute path to strip from the paths inside the coverage.xml, + # This ist /var/www/ (note the trailing slash) fort the shop and should be set to + # /var/www/dev-packages// for modules + strip_path: '/var/www/' + + # Sonarcloud settings, get them from https://sonarcloud.io/organizations/oxid-esales/projects + organization: 'oxid-esales' + project_key: 'OXID-eSales_oxideshop_ce' + project_name: 'oxideshop_ce' + # Parameters passed to the scanner + parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=source + -Dsonar.tests=tests + + # DEPRECATED: (we use a separate config for this now) for the internal run, leave the project key empty if you don't have a need + # for this second run with different settings + internal_project_key: 'OXID-eSales_oxideshop_ce_internal' + internal_project_name: 'oxideshop_ce_internal' + internal_parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=source/Internal + -Dsonar.tests=tests + +# See docs/actions/start_shop.md and docs/actions/phpcs.md for more information. +phpcs_tests: + skip: false + matrix: *matrix_slim + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + cache: + bucket: *cache_bucket + # Name of the branch/commit to gather the list of changed files + git: + ref: '{{ .Github.Ref }}' + # Should we use git diff or check all files + diff_only: true + # Filter the file n ames against this regex + filter: '\.php$' + # Optional: Additional options to pass to phpcs + additional_options: '-vp --standard=PSR12' + output: + files: | + data/php/logs/error_log.txt + prefix: 'phpcs-artifacts' + # Grep pattern which indicate that the test failed + failure_pattern: '[1-9][0-9]* error|[1-9][0-9]* warning' + +# See docs/actions/start_shop.md and docs/actions/phpmd.md for more information. +phpmd: + matrix: + php: *matrix_php_slim + mysql: *matrix_mysql_slim + # This is only used in the module workflow, so the default is to skip this + testplan: 'skip' + max_parallel: 8 + + # This is the name of the report and code artifact, you need to override it if you want + # to generate reports for multiple modules in one workflow + title: 'oxideshop_ce' + + load_shop: *install_module_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + file: 'source/composer.json' + backup: true + # Make sure, phpmd is installed properly + transform: | + { + "require-dev": { + "phpmd/phpmd": "@stable" + } + } + update: true + update_options: '--no-interaction' + + # Name of the source folder, relative to the path above. That is source for the shop + # and src for modules. + source_path: 'source/' + + # This is the folder we store the reports in (relative to /var/www in the container) + report_path: 'reports' + + # Path to the phpmd configuration file + config: 'tests/PhpMd/standard.xml' + + # Path to a phpmd baseline file + baseline_file: 'tests/PhpMd/phpmd.baseline.xml' + + # Additional options to pass to phpmd + additional_options: '' + + # If set to true, the report will run an additional composer phpmd to output into the github actions log + verbose: true + + # If set to true, the report will run phpstan to generate a new baseline file + generate_baseline: true + + output: + prefix: 'styles-phpmd' + + failure_pattern: &failure_pattern | + "warnings": + "violations": + "errors": + +phpstan: + matrix: + php: *matrix_php_slim + mysql: *matrix_mysql_slim + # This is only used in the module workflow, so the default is to skip this + testplan: 'skip' + max_parallel: 8 + + # This is the name of the report and code artifact, you need to override it if you want + # to generate reports for multiple modules in one workflow + title: 'oxideshop_ce' + + load_shop: *install_module_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + file: 'source/composer.json' + backup: true + # Make sure, phpmd is installed properly + transform: | + { + "preferred-install": { + "phpstan/phpstan": "dist" + }, + "require": { + "phpstan/phpstan": "^1.10" + } + } + update: true + update_options: '--no-interaction' + + # Name of the source folder, relative to the path above. That is source for the shop + # and src for modules. + source_path: 'source' + + # This is the folder we store the reports in (relative to /var/www in the container) + report_path: 'reports' + + # Path to the phpstan configuration file + neon_file: 'tests/PhpStan/phpstan.neon' + + # Additional options to pass to phpmd + additional_options: '--no-progress' + + # If set to true, the report will run phpstan a 2nd time to output into the github actions log + verbose: true + + # If set to true, the report will run phpstan to generate a new baseline file + generate_baseline: true + + output: + prefix: 'styles-phpstan' + + failure_pattern: &failure_pattern | + "errors":[1-9][0-9]* + "file_errors":[1-9][0-9]* + +styles: + matrix: + php: *matrix_php_slim + mysql: *matrix_mysql_slim + # This is only used in the module workflow, so the default is to skip this + testplan: 'skip' + max_parallel: 1 + # When looping over multiple modules, title must be set for every element + title: 'styles' + docker_login: *docker_login + load_shop: *install_module_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + file: 'source/dev-packages/test-module/composer.json' + backup: true + transform: '' + update: true + update_options: '--no-interaction' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # The path pointing to the module relative to source/dev-packages needs to be the same as in install_module + path: *module_path + + # The module_ids needs to be the same as in install_module + module_ids: *module_ids + + # These options are passed along to composer install + install_options: '' + + # Each iteration of the styles workflow will move their report to a distinct name in the central report folder + output: + files: | + source/tests/reports/phpstan*.report.json + source/tests/reports/phpmd*.report.json + source/tests/reports/phpcs*.report.json + source/tests/reports/phpstan*.report.txt + source/tests/reports/phpmd*.report.txt + source/tests/reports/phpcs*.report.txt + data/php/logs/error_log.txt + prefix: 'styles_artifacts' + +# yamllint validates the github actions/testplan yaml files +yamllint: + # Skip this part of the test run + skip: false + + # Rules for the linter + rules: | + extends: default + ignore: .git/* + rules: + document-start: disable + line-length: + max: 160 + level: warning + new-line-at-end-of-file: + level: warning + trailing-spaces: + level: warning + truthy: disable + + # Space separated list of files or directories + file_or_dir: '.github' + +# actionlint validates the github actions workflows (not actions) +actionlint: + # Skip this part of the test run + skip: false + +# This is the final cleanup at the end +finish: + # Skip this part of the test run + skip: false + # Using the global settings here + matrix: + php: *matrix_php + mysql: *matrix_mysql + # This is used as a title for slack notifications + slack_title: '{{ .Github.Workflow }} ({{ .Github.RefName }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' + # Should we use the compact slack format onstead of the long one? + slack_compact: true diff --git a/.github/oxid-esales/defaults/defaults_light.yaml.backup b/.github/oxid-esales/defaults/defaults_light.yaml.backup new file mode 100644 index 00000000..7afbf3cf --- /dev/null +++ b/.github/oxid-esales/defaults/defaults_light.yaml.backup @@ -0,0 +1,427 @@ +# Purpose +# ======= +# This file defines the default settings for the test workflow. It contains all +# variables. The variables can then be overridden in more specific yaml files +# to run different test scenarios. +# +# Variables used in multiple steps will be defined in the "workflow" and "global" +# sections and we use anchors to reference them in the specific sections. We use +# yamllint to validate the files, make sure to add linter exceptions, when you +# break the rules. +# +# We can use Golang templates in these test plans, see https://github.com/joernott/load_testplan/blob/main/README.md +# on how to reference environment variables and the github context. +# +# Sections +# ======== +# The yaml hierarchy will be flattened to simple key=value settings. The +# various levels of the yaml file here will become prefixes to the variable +# names. For each step of the testplan, we use use a section to have the +# variables for that step contain the same prefix. +# +# The "workflow" section contains global definitions of matrix variables and +# settings used in the "strategy" parts of a job. They have anchors and every +# specific job has its own variables which reference these anchors if no +# job specific exceptions are needed. +# +# The "global" section is much the same. The variables here are defaults with +# anchors which will be used inside the steps of the various other sections. +# + +# Global settings for a jobs strategy setting +workflow: + + # The variables "php" and "mysql" in the "matrix" subsection are used to run + # a matrix of all combinations of these values for testing. + matrix: &matrix + # This string contains a json array of php versions to test against. + php: &matrix_php '["8.2","8.3"]' + + # This string contains a json array of mysql versions to test + mysql: &matrix_mysql '["5.7","8.0.36"]' + + # This matrix definition is used, when we only want one analysis done + # It covers the recommended combination of PHP and MySQL + matrix_slim: &matrix_slim + php: &matrix_php_slim '["8.2"]' + mysql: &matrix_mysql_slim '["8.0.36"]' + testplan: 'skip' + script: 'skip' + + # How many matrix tests should run in parallel. When running on our private runners, we need to + # reduce this to get consistent test results + max_parallel: &max_parallel 4 + +# Global settings used in the actual steps in the jobs +global: + # The title of the workflow is used to distinguish multiple runs of the workflow triggered + # from one single trigger, e.g. a scheduled run + title: '{{ .Github.EventName }}-{{ .Github.RefName }}' + + # This action can be used on the community edition (ce) and enterprise + # edition (ee) of the shop. On top of setting this to true, a few extra + # variables/secrets must be provided for using the action on ee. + # If the variable is_enterprise is set to true, you need to provide the following variables: + # - secrets.enterprise_github_token + # - testplan entry global.git_enterprise_ref + is_enterprise: &is_enterprise false + # This template variable must be set to "ce" if is_enterprise is false or "ee" + # if is_enterprise is true. It will be used for determining object names + # {{ $shop_type := "ce" }}$shop_type: {{ printf "%q" $shop_type }} + + # Repository related settings + git: &git + # URL for the docker-eshop sdk repository to clone + # Deprecated, remove in v5 + sdk_url: &git_sdk_url 'https://github.com/OXID-eSales/docker-eshop-sdk.git' + # Name of the repository containing the oxideshop sdk + sdk_repository: &git_sdk_repository 'OXID-eSales/docker-eshop-sdk' + + # Branch to check out for the SDK + sdk_ref: &git_sdk_ref 'master' + + # URL for the oxidshop_ce repository + shop_url: &git_shop_url 'https://github.com/OXID-eSales/oxideshop_ce.git' + + # Branch, tag or hash of the commit to check out + shop_ref: &git_shop_ref '{{ .Github.RefName }}' + + # URL for the oxidshop_pe repository + enterprise_url: 'https://github.com/OXID-eSales/oxideshop_ee.git' + + # Branch to check out for the enterprise repos + enterprise_ref: &git_enterprise_ref 'b-8.0.x' + + # Branch to check out for modules/plugins etc + default_ref: &default_ref 'b-8.0.x' + + # This definition can be used instead of {{ .Github.RefName }}. In case + # of a pull request, the ref name is something like merge/42 which confuses + # composer. In the workflow, we then replace this with a working reference + safe_ref_name: '{{ .Github.RefName }}' + + # When running on a self hosted runner with access to a local s3 cache: + # Set the following secrets: + # - secrets.CACHE_ENDPOINT + # - secrets.CACHE_ACCESS_KEY + # - secrets.CACHE_SECRET_KEY + cache: &cache + bucket: &cache_bucket 'oxideshop-ee' + + # Should we log in to docker? If set to "true", you need to set the following + # secrets: + # - secrets.DOCKER_HUB_USER + # - secrets.DOCKER_HUB_TOKEN + docker_login: &docker_login true + + # Settings related to the container we run tests in + container: &container + + # Name of the container running php + name: &container_name 'php' + + # Additional options passed to docker compose when running tests in + # the the container + options: &container_options '' + + # Method to execute the commands inside a container. + # "run" spins up an entirely new container while "exec" runs inside the + # already running container. + method: &container_method 'exec' + + # These defaults are used when running the composer_configure and + # composer_require actions + composer: &composer + # This is just a definition we can apply in later configs + # It will be overwritten by the 7.0.x and 7.1.x templates + # and can be used by referencing .Data.global.composer.dev_ref + dev_ref: &dev_ref dev-b-8.0.x + + # This definition can be used instead of dev-{{ .Github.RefName }}. In case + # of a pull request, the ref name is something like merge/42 which confuses + # composer. In the workflow, we then replace this with a working reference + ref_name: dev-{{ .Github.RefName }} + + # Run composer for every module in the install job if early is set to true + # Do not use this with oxideshop-ce + early: &early false + + # Use these settings below to merge a json configuration with an existing + # composer.json + + # Path to the composer.json folder on the runner (source/composer.json, + # not /var/www/composer.json) + file: 'source/composer.json' + + # Should a backup of the original composer.json be created? + backup: true + + # Merge this json data with composer.json. If this is empty, + # no transformation will be applied + transform: '' + + # Should we run composer update + update: true + + # Options for composer update + update_options: '--no-interaction' + + # This grep pattern is applied to the generated phpunit, codeception and runtest log file. If we have + # a hit matching the pattern below, the step will fail. + failure_pattern: &failure_pattern | + 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]* + +# The init phase handles loading the testplans and creating report artifacts for the run +init: + cache: + bucket: *cache_bucket + name: '{{ .Github.EventName }}-{{ .Github.RefName }}-testplan-{{ .Env.GITHUB_REPOSITORY_ID }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# This step installs the sdk, shop and module(s) +install: + # This can be either 'legacy' or 'script' + method: 'legacy' + + # 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 + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + git: *git + + cache: + bucket: *cache_bucket + # Name of the complete cached shop installation + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + + # Should we cache the prepared shop for a shop setup test? + prepared_shop: true + + # Name of the prepared shop cached shop installation + prepared_shop_prefix: &prepare_shop_prefix 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + + composer: + <<: *composer + # This is a composer template we're transforming into whatever we need + root_url: 'https://raw.githubusercontent.com/OXID-eSales/docker-eshop-sdk-recipes/master/parts/bases/composer.json.base' + # This is the default transformation + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-8.0.x", + "oxid-esales/twig-admin-theme": "dev-b-8.0.x", + "oxid-esales/apex-theme": "dev-b-8.0.x" + } + } + + # Should we run composer transform in the install job (true) or only when running tests. + # The default is to run them just before running the tests only for that instance and module + early: false + + # These modify php "custom.ini" + custom_ini: + # Error reporting settings + error_reporting: 'E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING' + + # xdebug settings for php custom.ini + xdebug: 'xdebug.max_nesting_level=1000' + + # Space separated list of extra services to add + add_services: 'selenium-chrome-126' + + # Modifying source/source/config.inc.php + config: + # Set iDebug in source/source/config.inc.php + idebug: false + # Run custom script outside the container + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:setup:demodata' + custom_script_container: '' + + # Skip the shop installation logic (not needed for components) + skip_shop_installation: false + # Exporting an artifact with Configuration files for the shop setup + output: + files: | + docker-compose.yml + docker*.log + source/composer.json* + source/composer.lock + source/source/config.inc.php + source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php + data/php/logs/error_log.txt + data/mysql/mysql/slow_log* + data/mysql/mysql/general_log* + files.txt + # The configuration file name is dynamic, the matrix variables will be appended + artifact_prefix: 'shop-setup' + +runscript: &runscript + matrix: + <<: *matrix + # This needs to be set in the workflow config + script: 'skip' + max_parallel: 64 + # When looping over multiple modules, title must be set for every element + title: 'runscript' + # You need to specify the script name + script: '' + docker_login: *docker_login + load_shop: *install_shop_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + early: *early + file: 'source/dev-packages/test-module/composer.json' + backup: true + transform: '' + update: true + update_options: '--no-interaction' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # 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 + + # These options are passed along to composer install + install_options: '' + + # Each iteration of the styles workflow will move their report to a distinct name in the central report folder + output: + prefix: 'outputs' + + coverage: + prefix: 'coverage-reports-runscript' + +runslim: + <<: *runscript + matrix: *matrix_slim + +# Running the sonarcloud scanner on the gathered coverage reports +sonarcloud: + # We only run sonarcloud for one of the matrix combinations of PHP/MySQL + matrix: + php: '["8.1"]' + mysql: '["5.7"]' + testplan: '["-"]' + + # There is only one matrix combination + max_parallel: 1 + docker_login: *docker_login + + # You only need to change the title when running multiple sonarcloud scans in one workflow + title: 'sonarcloud' + + # By default, the current repository and the current branch are checked out. When running the + # workflow in a different repository, we need to change this + git: + repository: '' + ref: '' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + coverage: + prefix: coverage-report + target_branch: b-8.0.x + + # Part of the absolute path to strip from the paths inside the coverage.xml, + # This ist /var/www/ (note the trailing slash) fort the shop and should be set to + # /var/www/dev-packages// for modules + strip_path: '/var/www/' + + # Sonarcloud settings, get them from https://sonarcloud.io/organizations/oxid-esales/projects + organization: 'oxid-esales' + project_key: 'OXID-eSales_oxideshop_ce' + project_name: 'oxideshop_ce' + # Parameters passed to the scanner + parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=source + -Dsonar.tests=tests + +# yamllint validates the github actions/testplan yaml files +yamllint: + # Skip this part of the test run + skip: false + + # Rules for the linter + rules: | + extends: default + ignore: .git/* + rules: + document-start: disable + line-length: + max: 160 + level: warning + new-line-at-end-of-file: + level: warning + trailing-spaces: + level: warning + truthy: disable + + # Space separated list of files or directories + file_or_dir: '.github' + +# actionlint validates the github actions workflows (not actions) +actionlint: + # Skip this part of the test run + skip: false + +# This is the final cleanup at the end +finish: + # Skip this part of the test run + skip: false + # Using the global settings here + matrix: + php: *matrix_php + mysql: *matrix_mysql + # This is used as a title for slack notifications + slack_title: '{{ .Github.Workflow }} ({{ .Github.RefName }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' + # Should we use the compact slack format onstead of the long one? + slack_compact: true diff --git a/.github/oxid-esales/defaults/defaults_light.yml.backup b/.github/oxid-esales/defaults/defaults_light.yml.backup new file mode 100644 index 00000000..7afbf3cf --- /dev/null +++ b/.github/oxid-esales/defaults/defaults_light.yml.backup @@ -0,0 +1,427 @@ +# Purpose +# ======= +# This file defines the default settings for the test workflow. It contains all +# variables. The variables can then be overridden in more specific yaml files +# to run different test scenarios. +# +# Variables used in multiple steps will be defined in the "workflow" and "global" +# sections and we use anchors to reference them in the specific sections. We use +# yamllint to validate the files, make sure to add linter exceptions, when you +# break the rules. +# +# We can use Golang templates in these test plans, see https://github.com/joernott/load_testplan/blob/main/README.md +# on how to reference environment variables and the github context. +# +# Sections +# ======== +# The yaml hierarchy will be flattened to simple key=value settings. The +# various levels of the yaml file here will become prefixes to the variable +# names. For each step of the testplan, we use use a section to have the +# variables for that step contain the same prefix. +# +# The "workflow" section contains global definitions of matrix variables and +# settings used in the "strategy" parts of a job. They have anchors and every +# specific job has its own variables which reference these anchors if no +# job specific exceptions are needed. +# +# The "global" section is much the same. The variables here are defaults with +# anchors which will be used inside the steps of the various other sections. +# + +# Global settings for a jobs strategy setting +workflow: + + # The variables "php" and "mysql" in the "matrix" subsection are used to run + # a matrix of all combinations of these values for testing. + matrix: &matrix + # This string contains a json array of php versions to test against. + php: &matrix_php '["8.2","8.3"]' + + # This string contains a json array of mysql versions to test + mysql: &matrix_mysql '["5.7","8.0.36"]' + + # This matrix definition is used, when we only want one analysis done + # It covers the recommended combination of PHP and MySQL + matrix_slim: &matrix_slim + php: &matrix_php_slim '["8.2"]' + mysql: &matrix_mysql_slim '["8.0.36"]' + testplan: 'skip' + script: 'skip' + + # How many matrix tests should run in parallel. When running on our private runners, we need to + # reduce this to get consistent test results + max_parallel: &max_parallel 4 + +# Global settings used in the actual steps in the jobs +global: + # The title of the workflow is used to distinguish multiple runs of the workflow triggered + # from one single trigger, e.g. a scheduled run + title: '{{ .Github.EventName }}-{{ .Github.RefName }}' + + # This action can be used on the community edition (ce) and enterprise + # edition (ee) of the shop. On top of setting this to true, a few extra + # variables/secrets must be provided for using the action on ee. + # If the variable is_enterprise is set to true, you need to provide the following variables: + # - secrets.enterprise_github_token + # - testplan entry global.git_enterprise_ref + is_enterprise: &is_enterprise false + # This template variable must be set to "ce" if is_enterprise is false or "ee" + # if is_enterprise is true. It will be used for determining object names + # {{ $shop_type := "ce" }}$shop_type: {{ printf "%q" $shop_type }} + + # Repository related settings + git: &git + # URL for the docker-eshop sdk repository to clone + # Deprecated, remove in v5 + sdk_url: &git_sdk_url 'https://github.com/OXID-eSales/docker-eshop-sdk.git' + # Name of the repository containing the oxideshop sdk + sdk_repository: &git_sdk_repository 'OXID-eSales/docker-eshop-sdk' + + # Branch to check out for the SDK + sdk_ref: &git_sdk_ref 'master' + + # URL for the oxidshop_ce repository + shop_url: &git_shop_url 'https://github.com/OXID-eSales/oxideshop_ce.git' + + # Branch, tag or hash of the commit to check out + shop_ref: &git_shop_ref '{{ .Github.RefName }}' + + # URL for the oxidshop_pe repository + enterprise_url: 'https://github.com/OXID-eSales/oxideshop_ee.git' + + # Branch to check out for the enterprise repos + enterprise_ref: &git_enterprise_ref 'b-8.0.x' + + # Branch to check out for modules/plugins etc + default_ref: &default_ref 'b-8.0.x' + + # This definition can be used instead of {{ .Github.RefName }}. In case + # of a pull request, the ref name is something like merge/42 which confuses + # composer. In the workflow, we then replace this with a working reference + safe_ref_name: '{{ .Github.RefName }}' + + # When running on a self hosted runner with access to a local s3 cache: + # Set the following secrets: + # - secrets.CACHE_ENDPOINT + # - secrets.CACHE_ACCESS_KEY + # - secrets.CACHE_SECRET_KEY + cache: &cache + bucket: &cache_bucket 'oxideshop-ee' + + # Should we log in to docker? If set to "true", you need to set the following + # secrets: + # - secrets.DOCKER_HUB_USER + # - secrets.DOCKER_HUB_TOKEN + docker_login: &docker_login true + + # Settings related to the container we run tests in + container: &container + + # Name of the container running php + name: &container_name 'php' + + # Additional options passed to docker compose when running tests in + # the the container + options: &container_options '' + + # Method to execute the commands inside a container. + # "run" spins up an entirely new container while "exec" runs inside the + # already running container. + method: &container_method 'exec' + + # These defaults are used when running the composer_configure and + # composer_require actions + composer: &composer + # This is just a definition we can apply in later configs + # It will be overwritten by the 7.0.x and 7.1.x templates + # and can be used by referencing .Data.global.composer.dev_ref + dev_ref: &dev_ref dev-b-8.0.x + + # This definition can be used instead of dev-{{ .Github.RefName }}. In case + # of a pull request, the ref name is something like merge/42 which confuses + # composer. In the workflow, we then replace this with a working reference + ref_name: dev-{{ .Github.RefName }} + + # Run composer for every module in the install job if early is set to true + # Do not use this with oxideshop-ce + early: &early false + + # Use these settings below to merge a json configuration with an existing + # composer.json + + # Path to the composer.json folder on the runner (source/composer.json, + # not /var/www/composer.json) + file: 'source/composer.json' + + # Should a backup of the original composer.json be created? + backup: true + + # Merge this json data with composer.json. If this is empty, + # no transformation will be applied + transform: '' + + # Should we run composer update + update: true + + # Options for composer update + update_options: '--no-interaction' + + # This grep pattern is applied to the generated phpunit, codeception and runtest log file. If we have + # a hit matching the pattern below, the step will fail. + failure_pattern: &failure_pattern | + 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]* + +# The init phase handles loading the testplans and creating report artifacts for the run +init: + cache: + bucket: *cache_bucket + name: '{{ .Github.EventName }}-{{ .Github.RefName }}-testplan-{{ .Env.GITHUB_REPOSITORY_ID }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# This step installs the sdk, shop and module(s) +install: + # This can be either 'legacy' or 'script' + method: 'legacy' + + # 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 + max_parallel: *max_parallel + docker_login: *docker_login + container: *container + git: *git + + cache: + bucket: *cache_bucket + # Name of the complete cached shop installation + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + + # Should we cache the prepared shop for a shop setup test? + prepared_shop: true + + # Name of the prepared shop cached shop installation + prepared_shop_prefix: &prepare_shop_prefix 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + + composer: + <<: *composer + # This is a composer template we're transforming into whatever we need + root_url: 'https://raw.githubusercontent.com/OXID-eSales/docker-eshop-sdk-recipes/master/parts/bases/composer.json.base' + # This is the default transformation + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/twig-component": "dev-b-8.0.x", + "oxid-esales/twig-admin-theme": "dev-b-8.0.x", + "oxid-esales/apex-theme": "dev-b-8.0.x" + } + } + + # Should we run composer transform in the install job (true) or only when running tests. + # The default is to run them just before running the tests only for that instance and module + early: false + + # These modify php "custom.ini" + custom_ini: + # Error reporting settings + error_reporting: 'E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING' + + # xdebug settings for php custom.ini + xdebug: 'xdebug.max_nesting_level=1000' + + # Space separated list of extra services to add + add_services: 'selenium-chrome-126' + + # Modifying source/source/config.inc.php + config: + # Set iDebug in source/source/config.inc.php + idebug: false + # Run custom script outside the container + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:setup:demodata' + custom_script_container: '' + + # Skip the shop installation logic (not needed for components) + skip_shop_installation: false + # Exporting an artifact with Configuration files for the shop setup + output: + files: | + docker-compose.yml + docker*.log + source/composer.json* + source/composer.lock + source/source/config.inc.php + source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php + data/php/logs/error_log.txt + data/mysql/mysql/slow_log* + data/mysql/mysql/general_log* + files.txt + # The configuration file name is dynamic, the matrix variables will be appended + artifact_prefix: 'shop-setup' + +runscript: &runscript + matrix: + <<: *matrix + # This needs to be set in the workflow config + script: 'skip' + max_parallel: 64 + # When looping over multiple modules, title must be set for every element + title: 'runscript' + # You need to specify the script name + script: '' + docker_login: *docker_login + load_shop: *install_shop_prefix + container: *container + cache: + bucket: *cache_bucket + composer: + early: *early + file: 'source/dev-packages/test-module/composer.json' + backup: true + transform: '' + update: true + update_options: '--no-interaction' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + # 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 + + # These options are passed along to composer install + install_options: '' + + # Each iteration of the styles workflow will move their report to a distinct name in the central report folder + output: + prefix: 'outputs' + + coverage: + prefix: 'coverage-reports-runscript' + +runslim: + <<: *runscript + matrix: *matrix_slim + +# Running the sonarcloud scanner on the gathered coverage reports +sonarcloud: + # We only run sonarcloud for one of the matrix combinations of PHP/MySQL + matrix: + php: '["8.1"]' + mysql: '["5.7"]' + testplan: '["-"]' + + # There is only one matrix combination + max_parallel: 1 + docker_login: *docker_login + + # You only need to change the title when running multiple sonarcloud scans in one workflow + title: 'sonarcloud' + + # By default, the current repository and the current branch are checked out. When running the + # workflow in a different repository, we need to change this + git: + repository: '' + ref: '' + + # Run custom script outside the container' + custom_script: '' + + # Run custom script inside the container like 'bin/oe-console oe:b2b:installdemodata --shop-id=1' + custom_script_container: '' + + coverage: + prefix: coverage-report + target_branch: b-8.0.x + + # Part of the absolute path to strip from the paths inside the coverage.xml, + # This ist /var/www/ (note the trailing slash) fort the shop and should be set to + # /var/www/dev-packages// for modules + strip_path: '/var/www/' + + # Sonarcloud settings, get them from https://sonarcloud.io/organizations/oxid-esales/projects + organization: 'oxid-esales' + project_key: 'OXID-eSales_oxideshop_ce' + project_name: 'oxideshop_ce' + # Parameters passed to the scanner + parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=source + -Dsonar.tests=tests + +# yamllint validates the github actions/testplan yaml files +yamllint: + # Skip this part of the test run + skip: false + + # Rules for the linter + rules: | + extends: default + ignore: .git/* + rules: + document-start: disable + line-length: + max: 160 + level: warning + new-line-at-end-of-file: + level: warning + trailing-spaces: + level: warning + truthy: disable + + # Space separated list of files or directories + file_or_dir: '.github' + +# actionlint validates the github actions workflows (not actions) +actionlint: + # Skip this part of the test run + skip: false + +# This is the final cleanup at the end +finish: + # Skip this part of the test run + skip: false + # Using the global settings here + matrix: + php: *matrix_php + mysql: *matrix_mysql + # This is used as a title for slack notifications + slack_title: '{{ .Github.Workflow }} ({{ .Github.RefName }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' + # Should we use the compact slack format onstead of the long one? + slack_compact: true diff --git a/.github/oxid-esales/defaults/ee.yaml.backup b/.github/oxid-esales/defaults/ee.yaml.backup new file mode 100644 index 00000000..8b34942a --- /dev/null +++ b/.github/oxid-esales/defaults/ee.yaml.backup @@ -0,0 +1,155 @@ +# This config overrides defaults.yml to set the necessary settings for +# enterprise edition. +# You also need to make sure that the following secrets are defined: +# - CACHE_ENDPOINT +# - CACHE_ACCESS_KEY +# - CACHE_SECRET_KEY +# - enterprise_github_token + +global: + # {{ $shop_type := "ee" }}$shop_type: {{ printf "%q" $shop_type }} + is_enterprise: &is_enterprise true + + git: &git + # Using the stable branch for the ce shop here, and .Github.RefName refers to + # the ee shop commit/tag/branch + shop_ref: &git_shop_ref '{{ .Data.global.git.default_ref }}' + enterprise_ref: '{{ .Github.RefName }}' + +# See docs/actions/prepare_shop.md for more information. +install_shop_with_modules: &install + composer: + transform: | + { + "config": { + "github-protocols": ["https"] + }, + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "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.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" + }, + "repositories": { + "oxid-esales/twig-component-ee": { + "type": "git", + "url": "https://github.com/OXID-eSales/twig-component-ee.git" + }, + "oxid-esales/twig-component-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/twig-component-pe.git" + }, + "oxid-esales/oxideshop-ee": { + "type": "git", + "url": "https://github.com/OXID-eSales/oxideshop_ee.git" + }, + "oxid-esales/oxideshop-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/oxideshop_pe.git" + } + } + } + + git: *git + is_enterprise: *is_enterprise + cache: + # Needs to be here as $shop_type is different + prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +# See docs/actions/start_shop.md and docs/actions/install_shop.md for more information. +install_shop: + git: *git + is_enterprise: *is_enterprise + cache: + prefix: *install_shop_prefix + +install_module: + cache: + # Need to set this as we don't install a module. When installing a module: + # 'moduleInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: *install_shop_prefix + load_shop: *install_shop_prefix +# END Deprecated + +phpunit: + load_shop: *install_shop_prefix + +codeception: + load_shop: *install_shop_prefix + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + method: &selenium_container_method 'run' + configuration: 'vendor/oxid-esales/oxideshop-ee/Tests/codeception.yml' + additional_options: '' + output: + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/vendor/oxid-esales/oxideshop-ee/Tests/Codeception/_output + coverage: + path: '' + +runtest: + load_shop: *install_shop_prefix + container: + options: '-e ACTIVE_THEME=apex' + method: 'run' + composer: + transform: | + { + "require-dev": { + "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" + }, + "repositories": { + "oxid-esales/tests-deprecated-ee": { + "type": "git", + "url": "https://github.com/OXID-eSales/tests-deprecated-ee.git" + }, + "oxid-esales/tests-deprecated-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/tests-deprecated-pe.git" + } + } + } + # yamllint disable-line rule:line-length + additional_options: '--filter "/^((?!(testFrontendVAT)).)*$/" --exclude-group quarantine,varnish,paypal_buyerlogin,paypal_external,paypal_graphql,adminFunctionality,flow_theme' + coverage: + path: '' + +runscript: + load_shop: *install_shop_prefix + +runslim: + load_shop: *install_shop_prefix + +sonarcloud: + matrix: + testplan: 'skip' + +phpcs_tests: + filter: '^\./source/(Internal|vendor/oxid-esales/oxideshop-[ep]e/Internal)/.*\.php$' diff --git a/.github/oxid-esales/defaults/ee.yml.backup b/.github/oxid-esales/defaults/ee.yml.backup new file mode 100644 index 00000000..8b34942a --- /dev/null +++ b/.github/oxid-esales/defaults/ee.yml.backup @@ -0,0 +1,155 @@ +# This config overrides defaults.yml to set the necessary settings for +# enterprise edition. +# You also need to make sure that the following secrets are defined: +# - CACHE_ENDPOINT +# - CACHE_ACCESS_KEY +# - CACHE_SECRET_KEY +# - enterprise_github_token + +global: + # {{ $shop_type := "ee" }}$shop_type: {{ printf "%q" $shop_type }} + is_enterprise: &is_enterprise true + + git: &git + # Using the stable branch for the ce shop here, and .Github.RefName refers to + # the ee shop commit/tag/branch + shop_ref: &git_shop_ref '{{ .Data.global.git.default_ref }}' + enterprise_ref: '{{ .Github.RefName }}' + +# See docs/actions/prepare_shop.md for more information. +install_shop_with_modules: &install + composer: + transform: | + { + "config": { + "github-protocols": ["https"] + }, + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "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.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" + }, + "repositories": { + "oxid-esales/twig-component-ee": { + "type": "git", + "url": "https://github.com/OXID-eSales/twig-component-ee.git" + }, + "oxid-esales/twig-component-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/twig-component-pe.git" + }, + "oxid-esales/oxideshop-ee": { + "type": "git", + "url": "https://github.com/OXID-eSales/oxideshop_ee.git" + }, + "oxid-esales/oxideshop-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/oxideshop_pe.git" + } + } + } + + git: *git + is_enterprise: *is_enterprise + cache: + # Needs to be here as $shop_type is different + prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +# See docs/actions/start_shop.md and docs/actions/install_shop.md for more information. +install_shop: + git: *git + is_enterprise: *is_enterprise + cache: + prefix: *install_shop_prefix + +install_module: + cache: + # Need to set this as we don't install a module. When installing a module: + # 'moduleInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: *install_shop_prefix + load_shop: *install_shop_prefix +# END Deprecated + +phpunit: + load_shop: *install_shop_prefix + +codeception: + load_shop: *install_shop_prefix + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + method: &selenium_container_method 'run' + configuration: 'vendor/oxid-esales/oxideshop-ee/Tests/codeception.yml' + additional_options: '' + output: + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/vendor/oxid-esales/oxideshop-ee/Tests/Codeception/_output + coverage: + path: '' + +runtest: + load_shop: *install_shop_prefix + container: + options: '-e ACTIVE_THEME=apex' + method: 'run' + composer: + transform: | + { + "require-dev": { + "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" + }, + "repositories": { + "oxid-esales/tests-deprecated-ee": { + "type": "git", + "url": "https://github.com/OXID-eSales/tests-deprecated-ee.git" + }, + "oxid-esales/tests-deprecated-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/tests-deprecated-pe.git" + } + } + } + # yamllint disable-line rule:line-length + additional_options: '--filter "/^((?!(testFrontendVAT)).)*$/" --exclude-group quarantine,varnish,paypal_buyerlogin,paypal_external,paypal_graphql,adminFunctionality,flow_theme' + coverage: + path: '' + +runscript: + load_shop: *install_shop_prefix + +runslim: + load_shop: *install_shop_prefix + +sonarcloud: + matrix: + testplan: 'skip' + +phpcs_tests: + filter: '^\./source/(Internal|vendor/oxid-esales/oxideshop-[ep]e/Internal)/.*\.php$' diff --git a/.github/oxid-esales/defaults/module.yaml.backup b/.github/oxid-esales/defaults/module.yaml.backup new file mode 100644 index 00000000..a0f2f7a6 --- /dev/null +++ b/.github/oxid-esales/defaults/module.yaml.backup @@ -0,0 +1,46 @@ +install_shop_with_modules: + cache: + prepared_shop: false + composer: + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/oxideshop-ce": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/twig-component": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}", + "{{ .Data.global.org }}/{{ .Data.global.name }}": "{{ .Data.global.composer.ref_name }}" + }, + "repositories": { + "{{ .Data.global.org }}/{{ .Data.global.name }}": { + "type": "git", + "url": "https://github.com/{{ .Data.global.repo }}.git" + } + } + } + custom_script_container: | + vendor/bin/oe-console oe:module:activate "{{ .Data.global.ids }}" + {{ .Data.install_shop_with_modules.custom_script_container }} + +runscript: &runscript + module: + path: 'vendor/{{ .Data.global.org}}/{{ .Data.global.name }}' + +runslim: + <<: *runscript + +sonarcloud: + strip_path: '/var/www/vendor/{{ .Data.global.org}}/{{ .Data.global.name }}/' + parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=src + -Dsonar.tests=tests + +finish: + slack_title: '{{ print .Data.global.name }} ({{ .Data.global.git.shop_ref }}) by {{ .Github.Actor }}' diff --git a/.github/oxid-esales/defaults/module.yml.backup b/.github/oxid-esales/defaults/module.yml.backup new file mode 100644 index 00000000..a0f2f7a6 --- /dev/null +++ b/.github/oxid-esales/defaults/module.yml.backup @@ -0,0 +1,46 @@ +install_shop_with_modules: + cache: + prepared_shop: false + composer: + transform: | + { + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "oxid-esales/oxideshop-ce": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/twig-component": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}", + "oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}", + "{{ .Data.global.org }}/{{ .Data.global.name }}": "{{ .Data.global.composer.ref_name }}" + }, + "repositories": { + "{{ .Data.global.org }}/{{ .Data.global.name }}": { + "type": "git", + "url": "https://github.com/{{ .Data.global.repo }}.git" + } + } + } + custom_script_container: | + vendor/bin/oe-console oe:module:activate "{{ .Data.global.ids }}" + {{ .Data.install_shop_with_modules.custom_script_container }} + +runscript: &runscript + module: + path: 'vendor/{{ .Data.global.org}}/{{ .Data.global.name }}' + +runslim: + <<: *runscript + +sonarcloud: + strip_path: '/var/www/vendor/{{ .Data.global.org}}/{{ .Data.global.name }}/' + parameters: | + -Dsonar.language=php + -Dsonar.scm.provider=git + -Dsonar.sources=src + -Dsonar.tests=tests + +finish: + slack_title: '{{ print .Data.global.name }} ({{ .Data.global.git.shop_ref }}) by {{ .Github.Actor }}' diff --git a/.github/oxid-esales/defaults/module_codeception_Acceptance_71x.yaml.backup b/.github/oxid-esales/defaults/module_codeception_Acceptance_71x.yaml.backup new file mode 100644 index 00000000..b086e295 --- /dev/null +++ b/.github/oxid-esales/defaults/module_codeception_Acceptance_71x.yaml.backup @@ -0,0 +1,25 @@ +codeception: + title: codeception_acceptance_{{ .Data.install_module.ids }} + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/codeception.yml' + suite: 'Acceptance' + additional_options: '--ext DotReporter -g {{ .Data.install_module.ids }}' + logfile: + prefix: 'codeception' + output: + prefix: 'codeception-artifacts-{{ .Data.install_module.ids }}' + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/tests/Codeception/_output + source/dev-packages/{{ .Data.install_module.ids }}/tests/Codeception/_output + source/vendor/{{ .Data.install_module.package_name }}/tests/Codeception/_output + job_status*.txt + coverage: + path: '' + prefix: coverage-reports-codeception_Acceptance_{{ .Data.install_module.ids }} diff --git a/.github/oxid-esales/defaults/module_codeception_Acceptance_71x.yml.backup b/.github/oxid-esales/defaults/module_codeception_Acceptance_71x.yml.backup new file mode 100644 index 00000000..b086e295 --- /dev/null +++ b/.github/oxid-esales/defaults/module_codeception_Acceptance_71x.yml.backup @@ -0,0 +1,25 @@ +codeception: + title: codeception_acceptance_{{ .Data.install_module.ids }} + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/codeception.yml' + suite: 'Acceptance' + additional_options: '--ext DotReporter -g {{ .Data.install_module.ids }}' + logfile: + prefix: 'codeception' + output: + prefix: 'codeception-artifacts-{{ .Data.install_module.ids }}' + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/tests/Codeception/_output + source/dev-packages/{{ .Data.install_module.ids }}/tests/Codeception/_output + source/vendor/{{ .Data.install_module.package_name }}/tests/Codeception/_output + job_status*.txt + coverage: + path: '' + prefix: coverage-reports-codeception_Acceptance_{{ .Data.install_module.ids }} diff --git a/.github/oxid-esales/defaults/module_codeception_acceptance.yaml.backup b/.github/oxid-esales/defaults/module_codeception_acceptance.yaml.backup new file mode 100644 index 00000000..cb3a0f7c --- /dev/null +++ b/.github/oxid-esales/defaults/module_codeception_acceptance.yaml.backup @@ -0,0 +1,25 @@ +codeception: + title: codeception_acceptance_{{ .Data.install_module.ids }} + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/codeception.yml' + suite: 'acceptance' + additional_options: '--ext DotReporter -g {{ .Data.install_module.ids }}' + logfile: + prefix: 'codeception' + output: + prefix: 'codeception-artifacts-{{ .Data.install_module.ids }}' + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/tests/Codeception/_output + source/dev-packages/{{ .Data.install_module.ids }}/tests/Codeception/_output + source/vendor/{{ .Data.install_module.package_name }}/tests/Codeception/_output + job_status*.txt + coverage: + path: '' + prefix: coverage-reports-codeception_acceptance_{{ .Data.install_module.ids }} diff --git a/.github/oxid-esales/defaults/module_codeception_acceptance.yml.backup b/.github/oxid-esales/defaults/module_codeception_acceptance.yml.backup new file mode 100644 index 00000000..cb3a0f7c --- /dev/null +++ b/.github/oxid-esales/defaults/module_codeception_acceptance.yml.backup @@ -0,0 +1,25 @@ +codeception: + title: codeception_acceptance_{{ .Data.install_module.ids }} + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/codeception.yml' + suite: 'acceptance' + additional_options: '--ext DotReporter -g {{ .Data.install_module.ids }}' + logfile: + prefix: 'codeception' + output: + prefix: 'codeception-artifacts-{{ .Data.install_module.ids }}' + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/tests/Codeception/_output + source/dev-packages/{{ .Data.install_module.ids }}/tests/Codeception/_output + source/vendor/{{ .Data.install_module.package_name }}/tests/Codeception/_output + job_status*.txt + coverage: + path: '' + prefix: coverage-reports-codeception_acceptance_{{ .Data.install_module.ids }} diff --git a/.github/oxid-esales/defaults/module_phpunit_integration.yaml.backup b/.github/oxid-esales/defaults/module_phpunit_integration.yaml.backup new file mode 100644 index 00000000..cb03cbe0 --- /dev/null +++ b/.github/oxid-esales/defaults/module_phpunit_integration.yaml.backup @@ -0,0 +1,19 @@ +phpunit: + title: 'integration_tests-{{ .Data.install_module.ids }}' + container: + options: '-e XDEBUG_MODE=coverage' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/phpunit.xml' + test: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/Integration' + additional_options: '--bootstrap /var/www/source/bootstrap.php --coverage-clover=/var/www/coverage_phpunit_integration_{{ .Data.install_module.ids }}.xml' + logfile: + prefix: 'phpunit-integration-{{ .Data.install_module.ids }}' + output: + prefix: 'phpunit-integration-{{ .Data.install_module.ids }}-artifacts' + files: | + source/integration_coverage.xml + generated_testplan.yaml + source/source/log/oxideshop.log + data/php/logs/error_log.txt + coverage: + path: 'source/coverage_phpunit_integration_{{ .Data.install_module.ids }}.xml' + prefix: 'coverage-reports-phpunit_integration_{{ .Data.install_module.ids }}' diff --git a/.github/oxid-esales/defaults/module_phpunit_integration.yml.backup b/.github/oxid-esales/defaults/module_phpunit_integration.yml.backup new file mode 100644 index 00000000..cb03cbe0 --- /dev/null +++ b/.github/oxid-esales/defaults/module_phpunit_integration.yml.backup @@ -0,0 +1,19 @@ +phpunit: + title: 'integration_tests-{{ .Data.install_module.ids }}' + container: + options: '-e XDEBUG_MODE=coverage' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/phpunit.xml' + test: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/Integration' + additional_options: '--bootstrap /var/www/source/bootstrap.php --coverage-clover=/var/www/coverage_phpunit_integration_{{ .Data.install_module.ids }}.xml' + logfile: + prefix: 'phpunit-integration-{{ .Data.install_module.ids }}' + output: + prefix: 'phpunit-integration-{{ .Data.install_module.ids }}-artifacts' + files: | + source/integration_coverage.xml + generated_testplan.yaml + source/source/log/oxideshop.log + data/php/logs/error_log.txt + coverage: + path: 'source/coverage_phpunit_integration_{{ .Data.install_module.ids }}.xml' + prefix: 'coverage-reports-phpunit_integration_{{ .Data.install_module.ids }}' diff --git a/.github/oxid-esales/defaults/module_phpunit_unit.yaml.backup b/.github/oxid-esales/defaults/module_phpunit_unit.yaml.backup new file mode 100644 index 00000000..772ed92b --- /dev/null +++ b/.github/oxid-esales/defaults/module_phpunit_unit.yaml.backup @@ -0,0 +1,19 @@ +phpunit: + title: 'unit_tests_{{ .Data.install_module.ids }}' + container: + options: '-e XDEBUG_MODE=coverage' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/phpunit.xml' + test: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/Unit' + additional_options: '--bootstrap=/var/www/source/bootstrap.php --coverage-clover=/var/www/coverage_phpunit_unit_{{ .Data.install_module.ids }}.xml' + logfile: + prefix: 'phpunit-unit-{{ .Data.install_module.ids }}' + output: + prefix: 'phpunit-unit-{{ .Data.install_module.ids }}-artifacts' + files: | + source/unit_coverage.xml + generated_testplan.yaml + source/source/log/oxideshop.log + data/php/logs/error_log.txt + coverage: + path: 'source/coverage_phpunit_unit_{{ .Data.install_module.ids }}.xml' + prefix: 'coverage-reports-phpunit_unit_{{ .Data.install_module.ids }}' diff --git a/.github/oxid-esales/defaults/module_phpunit_unit.yml.backup b/.github/oxid-esales/defaults/module_phpunit_unit.yml.backup new file mode 100644 index 00000000..772ed92b --- /dev/null +++ b/.github/oxid-esales/defaults/module_phpunit_unit.yml.backup @@ -0,0 +1,19 @@ +phpunit: + title: 'unit_tests_{{ .Data.install_module.ids }}' + container: + options: '-e XDEBUG_MODE=coverage' + configuration: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/phpunit.xml' + test: '/var/www/vendor/{{ .Data.install_module.package_name }}/tests/Unit' + additional_options: '--bootstrap=/var/www/source/bootstrap.php --coverage-clover=/var/www/coverage_phpunit_unit_{{ .Data.install_module.ids }}.xml' + logfile: + prefix: 'phpunit-unit-{{ .Data.install_module.ids }}' + output: + prefix: 'phpunit-unit-{{ .Data.install_module.ids }}-artifacts' + files: | + source/unit_coverage.xml + generated_testplan.yaml + source/source/log/oxideshop.log + data/php/logs/error_log.txt + coverage: + path: 'source/coverage_phpunit_unit_{{ .Data.install_module.ids }}.xml' + prefix: 'coverage-reports-phpunit_unit_{{ .Data.install_module.ids }}' diff --git a/.github/oxid-esales/defaults/module_styles.yaml.backup b/.github/oxid-esales/defaults/module_styles.yaml.backup new file mode 100644 index 00000000..a51f0721 --- /dev/null +++ b/.github/oxid-esales/defaults/module_styles.yaml.backup @@ -0,0 +1,20 @@ +phpmd: + # This is the name of the report and code artifact, you need to override it if you want + # to generate reports for multiple modules in one workflow + title: '{{ .Data.install_module.package_name }}' + + composer: + file: 'vendor/{{ .Data.install_module.package_name }}/composer.json' + + # Name of the source folder, relative to the path above. That is source for the shop + # and src for modules. + source_folder: 'vendor/{{ .Data.install_module.package_name }}/src' + + # This is the folder we store the reports in (relative to /var/www in the container) + reports_path: 'reports' + + # Path to the phpmd configuration file + config: 'vendor/{{ .Data.install_module.package_name }}/tests/PhpMd/standard.xml' + + # If set to true, the report will run an additional composer phpmd to output into the github actions log + verbose: false diff --git a/.github/oxid-esales/defaults/module_styles.yml.backup b/.github/oxid-esales/defaults/module_styles.yml.backup new file mode 100644 index 00000000..a51f0721 --- /dev/null +++ b/.github/oxid-esales/defaults/module_styles.yml.backup @@ -0,0 +1,20 @@ +phpmd: + # This is the name of the report and code artifact, you need to override it if you want + # to generate reports for multiple modules in one workflow + title: '{{ .Data.install_module.package_name }}' + + composer: + file: 'vendor/{{ .Data.install_module.package_name }}/composer.json' + + # Name of the source folder, relative to the path above. That is source for the shop + # and src for modules. + source_folder: 'vendor/{{ .Data.install_module.package_name }}/src' + + # This is the folder we store the reports in (relative to /var/www in the container) + reports_path: 'reports' + + # Path to the phpmd configuration file + config: 'vendor/{{ .Data.install_module.package_name }}/tests/PhpMd/standard.xml' + + # If set to true, the report will run an additional composer phpmd to output into the github actions log + verbose: false diff --git a/.github/oxid-esales/defaults/pe.yaml.backup b/.github/oxid-esales/defaults/pe.yaml.backup new file mode 100644 index 00000000..8f90ca94 --- /dev/null +++ b/.github/oxid-esales/defaults/pe.yaml.backup @@ -0,0 +1,139 @@ +# This config overrides defaults.yml to set the necessary settings for +# enterprise edition. +# You also need to make sure that the following secrets are defined: +# - CACHE_ENDPOINT +# - CACHE_ACCESS_KEY +# - CACHE_SECRET_KEY +# - enterprise_github_token + +global: + # {{ $shop_type := "pe" }}$shop_type: {{ printf "%q" $shop_type }} + is_enterprise: &is_enterprise true + + git: &git + # Using the stable branch for the ce shop here, and .Github.RefName refers to + # the ee shop commit/tag/branch + shop_ref: &git_shop_ref '{{ .Data.global.git.default_ref }}' + enterprise_ref: '{{ .Github.RefName }}' + +# See docs/actions/prepare_shop.md for more information. +install_shop_with_modules: &install + composer: + transform: | + { + "config": { + "github-protocols": ["https"] + }, + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "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.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" + }, + "repositories": { + "oxid-esales/twig-component-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/twig-component-pe.git" + }, + "oxid-esales/oxideshop-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/oxideshop_pe.git" + } + } + } + + git: *git + is_enterprise: *is_enterprise + cache: + # Needs to be here as $shop_type is different + prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +# See docs/actions/start_shop.md and docs/actions/install_shop.md for more information. +install_shop: + git: *git + is_enterprise: *is_enterprise + cache: + prefix: *install_shop_prefix + +install_module: + cache: + # Need to set this as we don't install a module. When installing a module: + # 'moduleInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: *install_shop_prefix + load_shop: *install_shop_prefix +# END Deprecated + +phpunit: + load_shop: *install_shop_prefix + +codeception: + load_shop: *install_shop_prefix + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + method: &selenium_container_method 'run' + configuration: 'vendor/oxid-esales/oxideshop-pe/Tests/codeception.yml' + additional_options: '' + output: + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/vendor/oxid-esales/oxideshop-pe/Tests/Codeception/_output + coverage: + path: '' + +runtest: + load_shop: *install_shop_prefix + container: + options: '-e ACTIVE_THEME=apex' + method: 'run' + composer: + transform: | + { + "require-dev": { + "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" + }, + "oxid-esales/tests-deprecated-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/tests-deprecated-pe.git" + } + } + } + # yamllint disable-line rule:line-length + additional_options: '--filter "/^((?!(testFrontendVAT)).)*$/" --exclude-group quarantine,varnish,paypal_buyerlogin,paypal_external,paypal_graphql,adminFunctionality,flow_theme' + coverage: + path: '' + +runscript: + load_shop: *install_shop_prefix + +runslim: + load_shop: *install_shop_prefix + +sonarcloud: + matrix: + testplan: 'skip' + +phpcs_tests: + filter: '^\./source/(Internal|vendor/oxid-esales/oxideshop-pe/Internal)/.*\.php$' diff --git a/.github/oxid-esales/defaults/pe.yml.backup b/.github/oxid-esales/defaults/pe.yml.backup new file mode 100644 index 00000000..8f90ca94 --- /dev/null +++ b/.github/oxid-esales/defaults/pe.yml.backup @@ -0,0 +1,139 @@ +# This config overrides defaults.yml to set the necessary settings for +# enterprise edition. +# You also need to make sure that the following secrets are defined: +# - CACHE_ENDPOINT +# - CACHE_ACCESS_KEY +# - CACHE_SECRET_KEY +# - enterprise_github_token + +global: + # {{ $shop_type := "pe" }}$shop_type: {{ printf "%q" $shop_type }} + is_enterprise: &is_enterprise true + + git: &git + # Using the stable branch for the ce shop here, and .Github.RefName refers to + # the ee shop commit/tag/branch + shop_ref: &git_shop_ref '{{ .Data.global.git.default_ref }}' + enterprise_ref: '{{ .Github.RefName }}' + +# See docs/actions/prepare_shop.md for more information. +install_shop_with_modules: &install + composer: + transform: | + { + "config": { + "github-protocols": ["https"] + }, + "preferred-install": { + "oxid-esales/*": "source", + "oxid-professional-services/*": "source", + "ddoe/*": "source" + }, + "require": { + "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.ref_name }}", + "oxid-esales/codeception-page-objects": "{{ .Data.global.composer.ref_name }}" + }, + "repositories": { + "oxid-esales/twig-component-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/twig-component-pe.git" + }, + "oxid-esales/oxideshop-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/oxideshop_pe.git" + } + } + } + + git: *git + is_enterprise: *is_enterprise + cache: + # Needs to be here as $shop_type is different + prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +# BEGIN Deprecated, will be superseded by install: +prepare_shop: *install + +# See docs/actions/start_shop.md and docs/actions/install_shop.md for more information. +install_shop: + git: *git + is_enterprise: *is_enterprise + cache: + prefix: *install_shop_prefix + +install_module: + cache: + # Need to set this as we don't install a module. When installing a module: + # 'moduleInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + prefix: *install_shop_prefix + load_shop: *install_shop_prefix +# END Deprecated + +phpunit: + load_shop: *install_shop_prefix + +codeception: + load_shop: *install_shop_prefix + container: + options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e THEME_ID=apex' + method: &selenium_container_method 'run' + configuration: 'vendor/oxid-esales/oxideshop-pe/Tests/codeception.yml' + additional_options: '' + output: + files: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + source/source/log/oxideshop.log + data/php/logs/error_log.txt + source/vendor/oxid-esales/oxideshop-pe/Tests/Codeception/_output + coverage: + path: '' + +runtest: + load_shop: *install_shop_prefix + container: + options: '-e ACTIVE_THEME=apex' + method: 'run' + composer: + transform: | + { + "require-dev": { + "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" + }, + "oxid-esales/tests-deprecated-pe": { + "type": "git", + "url": "https://github.com/OXID-eSales/tests-deprecated-pe.git" + } + } + } + # yamllint disable-line rule:line-length + additional_options: '--filter "/^((?!(testFrontendVAT)).)*$/" --exclude-group quarantine,varnish,paypal_buyerlogin,paypal_external,paypal_graphql,adminFunctionality,flow_theme' + coverage: + path: '' + +runscript: + load_shop: *install_shop_prefix + +runslim: + load_shop: *install_shop_prefix + +sonarcloud: + matrix: + testplan: 'skip' + +phpcs_tests: + filter: '^\./source/(Internal|vendor/oxid-esales/oxideshop-pe/Internal)/.*\.php$' diff --git a/.github/oxid-esales/defaults/php8.0_mysql5.7_only.yaml.backup b/.github/oxid-esales/defaults/php8.0_mysql5.7_only.yaml.backup new file mode 100644 index 00000000..f031ec4c --- /dev/null +++ b/.github/oxid-esales/defaults/php8.0_mysql5.7_only.yaml.backup @@ -0,0 +1,50 @@ +prepare_shop: + matrix: &matrix + php: '["8.0"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.0_mysql5.7_only.yml.backup b/.github/oxid-esales/defaults/php8.0_mysql5.7_only.yml.backup new file mode 100644 index 00000000..f031ec4c --- /dev/null +++ b/.github/oxid-esales/defaults/php8.0_mysql5.7_only.yml.backup @@ -0,0 +1,50 @@ +prepare_shop: + matrix: &matrix + php: '["8.0"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.0_mysql8.0_only.yaml.backup b/.github/oxid-esales/defaults/php8.0_mysql8.0_only.yaml.backup new file mode 100644 index 00000000..88d08fd8 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.0_mysql8.0_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.0"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.0_mysql8.0_only.yml.backup b/.github/oxid-esales/defaults/php8.0_mysql8.0_only.yml.backup new file mode 100644 index 00000000..88d08fd8 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.0_mysql8.0_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.0"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_all_dbs.yaml b/.github/oxid-esales/defaults/php8.1_all_dbs.yaml new file mode 100644 index 00000000..63073da6 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_all_dbs.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_all_dbs.yaml.backup b/.github/oxid-esales/defaults/php8.1_all_dbs.yaml.backup new file mode 100644 index 00000000..63073da6 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_all_dbs.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mariadb10_only.yaml.backup b/.github/oxid-esales/defaults/php8.1_mariadb10_only.yaml.backup new file mode 100644 index 00000000..2bef2fb1 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mariadb10_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["mariadb-10"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mariadb11_only.yaml.backup b/.github/oxid-esales/defaults/php8.1_mariadb11_only.yaml.backup new file mode 100644 index 00000000..f08d2a0a --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mariadb11_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["mariadb-11"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mysql5.7_only.yaml.backup b/.github/oxid-esales/defaults/php8.1_mysql5.7_only.yaml.backup new file mode 100644 index 00000000..5b98a262 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mysql5.7_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mysql5.7_only.yml.backup b/.github/oxid-esales/defaults/php8.1_mysql5.7_only.yml.backup new file mode 100644 index 00000000..5b98a262 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mysql5.7_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mysql8.0_only.yaml.backup b/.github/oxid-esales/defaults/php8.1_mysql8.0_only.yaml.backup new file mode 100644 index 00000000..331d0ee6 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mysql8.0_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mysql8.0_only.yml.backup b/.github/oxid-esales/defaults/php8.1_mysql8.0_only.yml.backup new file mode 100644 index 00000000..331d0ee6 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mysql8.0_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mysql8_only.yaml.backup b/.github/oxid-esales/defaults/php8.1_mysql8_only.yaml.backup new file mode 100644 index 00000000..d9e9f396 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mysql8_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["mysql-8"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mysql9_only.yaml b/.github/oxid-esales/defaults/php8.1_mysql9_only.yaml new file mode 100644 index 00000000..d4b5be5e --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mysql9_only.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.1_mysql9_only.yaml.backup b/.github/oxid-esales/defaults/php8.1_mysql9_only.yaml.backup new file mode 100644 index 00000000..d4b5be5e --- /dev/null +++ b/.github/oxid-esales/defaults/php8.1_mysql9_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.1"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_all_dbs.yaml b/.github/oxid-esales/defaults/php8.2_all_dbs.yaml new file mode 100644 index 00000000..2835e51a --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_all_dbs.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_all_dbs.yaml.backup b/.github/oxid-esales/defaults/php8.2_all_dbs.yaml.backup new file mode 100644 index 00000000..2835e51a --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_all_dbs.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mariadb10_only.yaml.backup b/.github/oxid-esales/defaults/php8.2_mariadb10_only.yaml.backup new file mode 100644 index 00000000..e8c5c9e0 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mariadb10_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["mariadb-10"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mariadb11_only.yaml.backup b/.github/oxid-esales/defaults/php8.2_mariadb11_only.yaml.backup new file mode 100644 index 00000000..e7b08aa0 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mariadb11_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["mariadb-11"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mysql5.7_only.yaml.backup b/.github/oxid-esales/defaults/php8.2_mysql5.7_only.yaml.backup new file mode 100644 index 00000000..f0aed159 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mysql5.7_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mysql5.7_only.yml.backup b/.github/oxid-esales/defaults/php8.2_mysql5.7_only.yml.backup new file mode 100644 index 00000000..f0aed159 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mysql5.7_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mysql8.0_only.yaml.backup b/.github/oxid-esales/defaults/php8.2_mysql8.0_only.yaml.backup new file mode 100644 index 00000000..7a3a9d0d --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mysql8.0_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mysql8.0_only.yml.backup b/.github/oxid-esales/defaults/php8.2_mysql8.0_only.yml.backup new file mode 100644 index 00000000..7a3a9d0d --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mysql8.0_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mysql8_only.yaml.backup b/.github/oxid-esales/defaults/php8.2_mysql8_only.yaml.backup new file mode 100644 index 00000000..0f35009a --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mysql8_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["mysql-8"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mysql9_only.yaml b/.github/oxid-esales/defaults/php8.2_mysql9_only.yaml new file mode 100644 index 00000000..a54c2f7d --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mysql9_only.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.2_mysql9_only.yaml.backup b/.github/oxid-esales/defaults/php8.2_mysql9_only.yaml.backup new file mode 100644 index 00000000..a54c2f7d --- /dev/null +++ b/.github/oxid-esales/defaults/php8.2_mysql9_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.2"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_all_dbs.yaml b/.github/oxid-esales/defaults/php8.3_all_dbs.yaml new file mode 100644 index 00000000..511d8ff9 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_all_dbs.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_all_dbs.yaml.backup b/.github/oxid-esales/defaults/php8.3_all_dbs.yaml.backup new file mode 100644 index 00000000..511d8ff9 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_all_dbs.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mariadb10_only.yaml.backup b/.github/oxid-esales/defaults/php8.3_mariadb10_only.yaml.backup new file mode 100644 index 00000000..ec49faa5 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mariadb10_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["mariadb-10"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mariadb11_only.yaml.backup b/.github/oxid-esales/defaults/php8.3_mariadb11_only.yaml.backup new file mode 100644 index 00000000..0b11c338 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mariadb11_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["mariadb-11"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mysql5.7_only.yaml.backup b/.github/oxid-esales/defaults/php8.3_mysql5.7_only.yaml.backup new file mode 100644 index 00000000..2b6dbda4 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mysql5.7_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mysql5.7_only.yml.backup b/.github/oxid-esales/defaults/php8.3_mysql5.7_only.yml.backup new file mode 100644 index 00000000..2b6dbda4 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mysql5.7_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mysql8.0_only.yaml.backup b/.github/oxid-esales/defaults/php8.3_mysql8.0_only.yaml.backup new file mode 100644 index 00000000..28e20b5e --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mysql8.0_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mysql8.0_only.yml.backup b/.github/oxid-esales/defaults/php8.3_mysql8.0_only.yml.backup new file mode 100644 index 00000000..28e20b5e --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mysql8.0_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mysql8_only.yaml.backup b/.github/oxid-esales/defaults/php8.3_mysql8_only.yaml.backup new file mode 100644 index 00000000..5dd18a91 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mysql8_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["mysql-8"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mysql9_only.yaml b/.github/oxid-esales/defaults/php8.3_mysql9_only.yaml new file mode 100644 index 00000000..5f466103 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mysql9_only.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.3_mysql9_only.yaml.backup b/.github/oxid-esales/defaults/php8.3_mysql9_only.yaml.backup new file mode 100644 index 00000000..5f466103 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.3_mysql9_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.3"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_all_dbs.yaml b/.github/oxid-esales/defaults/php8.4_all_dbs.yaml new file mode 100644 index 00000000..fd1ea14b --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_all_dbs.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_all_dbs.yaml.backup b/.github/oxid-esales/defaults/php8.4_all_dbs.yaml.backup new file mode 100644 index 00000000..fd1ea14b --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_all_dbs.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '[ "mysql-5.7", "mysql-8.0", "mysql-8", "mysql-9", "mariadb-10", "mariadb-11" ]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mariadb10_only.yaml.backup b/.github/oxid-esales/defaults/php8.4_mariadb10_only.yaml.backup new file mode 100644 index 00000000..d7c6df79 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mariadb10_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '["mariadb-10"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mariadb11_only.yaml.backup b/.github/oxid-esales/defaults/php8.4_mariadb11_only.yaml.backup new file mode 100644 index 00000000..8d606432 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mariadb11_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '["mariadb-11"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mysql5.7_only.yaml.backup b/.github/oxid-esales/defaults/php8.4_mysql5.7_only.yaml.backup new file mode 100644 index 00000000..60d6a8d1 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mysql5.7_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mysql5.7_only.yml.backup b/.github/oxid-esales/defaults/php8.4_mysql5.7_only.yml.backup new file mode 100644 index 00000000..60d6a8d1 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mysql5.7_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '["5.7"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mysql8.0_only.yaml.backup b/.github/oxid-esales/defaults/php8.4_mysql8.0_only.yaml.backup new file mode 100644 index 00000000..245c3e19 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mysql8.0_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4-rc"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mysql8.0_only.yml.backup b/.github/oxid-esales/defaults/php8.4_mysql8.0_only.yml.backup new file mode 100644 index 00000000..245c3e19 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mysql8.0_only.yml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4-rc"]' + mysql: '["8.0.36"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mysql8_only.yaml.backup b/.github/oxid-esales/defaults/php8.4_mysql8_only.yaml.backup new file mode 100644 index 00000000..31162c58 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mysql8_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '["mysql-8"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mysql9_only.yaml b/.github/oxid-esales/defaults/php8.4_mysql9_only.yaml new file mode 100644 index 00000000..f28358a8 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mysql9_only.yaml @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/php8.4_mysql9_only.yaml.backup b/.github/oxid-esales/defaults/php8.4_mysql9_only.yaml.backup new file mode 100644 index 00000000..f28358a8 --- /dev/null +++ b/.github/oxid-esales/defaults/php8.4_mysql9_only.yaml.backup @@ -0,0 +1,51 @@ +prepare_shop: + matrix: &matrix + php: '["8.4"]' + mysql: '["mysql-9"]' + +install_shop: + matrix: *matrix + max_parallel: 1 + +install_module: + matrix: *matrix + max_parallel: 1 + +install_shop_with_modules: + matrix: *matrix + max_parallel: 1 + +runscript: + matrix: *matrix + +runslim: + matrix: *matrix + +phpunit: + matrix: *matrix + +codeception: + matrix: *matrix + +runtest: + matrix: *matrix + +sonarcloud: + matrix: *matrix + max_parallel: 1 + +phpcs_tests: + matrix: *matrix + max_parallel: 1 + +phpmd: + matrix: *matrix + max_parallel: 1 + +phpstan: + matrix: *matrix + max_parallel: 1 + +styles: + matrix: *matrix + max_parallel: 1 diff --git a/.github/oxid-esales/defaults/scheduled.yaml.backup b/.github/oxid-esales/defaults/scheduled.yaml.backup new file mode 100644 index 00000000..597822a7 --- /dev/null +++ b/.github/oxid-esales/defaults/scheduled.yaml.backup @@ -0,0 +1,29 @@ +# This overrides the default shop settings for scheduled workflows testing +# 7.0.x and 7.1.x because they can only be started from 8.0.x due +# to github limitations on scheduled events + +global: + title: '{{ .Github.EventName }}-{{ .Data.global.git.default_ref }}' + git: &git + shop_ref: '{{ .Data.global.git.default_ref }}' + ref: '{{ .Data.global.git.default_ref }}' + enterprise_ref: '{{ .Data.global.git.default_ref }}' + safe_ref_name: '{{ .Data.global.git.default_ref }}' + composer: &composer + ref_name: 'dev-{{ .Data.global.git.default_ref }}' + +init: + cache: + name: '{{ .Github.EventName }}-{{ .Data.global.git.default_ref }}-testplan-{{ .Env.GITHUB_REPOSITORY_ID }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +install_shop_with_modules: &install + git: *git + composer: *composer + +prepare_shop: *install + +sonarcloud: + target_branch: '{{ .Data.global.git.default_ref }}' + +finish: + slack_title: '{{ .Github.Workflow }} ({{ .Data.global.git.default_ref }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' diff --git a/.github/oxid-esales/defaults/scheduled.yml.backup b/.github/oxid-esales/defaults/scheduled.yml.backup new file mode 100644 index 00000000..597822a7 --- /dev/null +++ b/.github/oxid-esales/defaults/scheduled.yml.backup @@ -0,0 +1,29 @@ +# This overrides the default shop settings for scheduled workflows testing +# 7.0.x and 7.1.x because they can only be started from 8.0.x due +# to github limitations on scheduled events + +global: + title: '{{ .Github.EventName }}-{{ .Data.global.git.default_ref }}' + git: &git + shop_ref: '{{ .Data.global.git.default_ref }}' + ref: '{{ .Data.global.git.default_ref }}' + enterprise_ref: '{{ .Data.global.git.default_ref }}' + safe_ref_name: '{{ .Data.global.git.default_ref }}' + composer: &composer + ref_name: 'dev-{{ .Data.global.git.default_ref }}' + +init: + cache: + name: '{{ .Github.EventName }}-{{ .Data.global.git.default_ref }}-testplan-{{ .Env.GITHUB_REPOSITORY_ID }}-{{ .Github.SHA }}-{{ .Github.RunID }}' + +install_shop_with_modules: &install + git: *git + composer: *composer + +prepare_shop: *install + +sonarcloud: + target_branch: '{{ .Data.global.git.default_ref }}' + +finish: + slack_title: '{{ .Github.Workflow }} ({{ .Data.global.git.default_ref }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' diff --git a/.github/workflows/call-universal_test_workflow.yaml.backup b/.github/workflows/call-universal_test_workflow.yaml.backup new file mode 100644 index 00000000..ed85c590 --- /dev/null +++ b/.github/workflows/call-universal_test_workflow.yaml.backup @@ -0,0 +1,1795 @@ +name: universal_test_workflow +# This workflow loads a base testplan, creates cached shop instances and runs +# phpunit, codeception and runtest based tests as well as code scans +# and sonarcloud reports +# +# yamllint disable-line rule:truthy +on: + workflow_call: + inputs: + testplan: + type: string + description: 'Testplan to run' + required: true + runs_on: + type: string + description: 'JSON string/array describing the runner' + required: true + defaults: + type: string + description: 'Which ref do we want to use for the plan defaults' + required: false + default: 'v3' + plan_folder: + type: string + description: 'Folder containing the test plans' + required: false + default: 'tests/github_actions' + default_plan_folder: + type: string + description: 'Folder containing the test plan templates' + required: false + default: '.github/oxid-esales/defaults' + debug: + type: boolean + description: 'Enable debugging' + default: true + required: false + custom_testplan_yaml: + type: string + description: 'Content of ~/oxid-esales/_custom.yaml' + default: '' + required: false + + secrets: + DOCKER_HUB_USER: + # description: 'user for the docker login' + required: false + DOCKER_HUB_TOKEN: + # description: 'Token for the docker login' + required: false + CACHE_ENDPOINT: + # description: 'Endpoint for tespkg/actions-cache@v1' + required: false # only for ee + CACHE_ACCESS_KEY: + # description: 'Access key for tespkg/actions-cache@v1' + required: false # only for ee + CACHE_SECRET_KEY: + # description: 'Secret key for tespkg/actions-cache@v1' + required: false # only for ee + enterprise_github_token: + # description: 'OAuth token to access enterprise repos' + required: false + SONAR_TOKEN: + # description: Token for sonarcloud access + required: false + SLACK_WEBHOOK_URL: + required: false + # description: Webhook for posting to SLACK + +jobs: + init: + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Checkout testplan defaults' + uses: actions/checkout@v4 + with: + repository: 'OXID-eSales/github-actions' + ref: '${{ inputs.defaults }}' + path: 'defaults' + sparse-checkout: '${{ inputs.default_plan_folder }}' + + - name: 'Checkout testplans' + uses: actions/checkout@v4 + with: + sparse-checkout: | + ${{ inputs.plan_folder}} + composer.json + path: workflow + + - name: 'Consolidate plans' + id: consolidate_plans + run: | + mkdir -p '${{ inputs.plan_folder }}/defaults' + if [ -d workflow/${{ inputs.plan_folder }} ]; then + mv workflow/${{ inputs.plan_folder }}/* '${{ inputs.plan_folder }}/' + /bin/rm -r 'workflow/${{ inputs.plan_folder }}' + fi + if [ -f workflow/composer.json ]; then + mv workflow/composer.json '${{ inputs.plan_folder }}/' + fi + mv defaults/${{ inputs.default_plan_folder}}/* '${{ inputs.plan_folder }}/defaults/' + cat >'${{ inputs.plan_folder }}/_custom.yaml' <<'EOF' + # Generated from workflow input custom_testplan_yaml + ${{ inputs.custom_testplan_yaml }} + EOF + # The next line can be removed in v5 when the transition to yaml is finished + cp '${{ inputs.plan_folder }}/_custom.yaml' '${{ inputs.plan_folder }}/_custom.yml' + TESTPLAN=$(echo "${{ inputs.testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g') + echo "testplan=${{ inputs.plan_folder }}/defaults/defaults.yaml,${TESTPLAN}" >>"${GITHUB_OUTPUT}" + + - name: 'Load Testplan' + id: ltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{ steps.consolidate_plans.outputs.testplan }}' + set_output: true + set_env: true + set_print: true + # loglevel: trace + # logfile: load_testplan.log + yaml: generated_testplan.yaml + + - name: 'Prepare artifact and generate safe title' + id: post_ltp + if: always() + run: | + cp "${GITHUB_OUTPUT}" generated_output.txt + cp "${GITHUB_ENV}" generated_env.txt + echo 'title=${{steps.ltp.outputs.global_title}}'| \ + sed -E 's#\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \ + tee -a "${GITHUB_OUTPUT}" + + - name: Cache testplan + uses: tespkg/actions-cache/save@v1 + with: + path: | + ${{ inputs.plan_folder }}/* + key: '${{ steps.ltp.outputs.init_cache_name }}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + + - name: Install missing python3-yaml on private runners + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + shell: bash + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update + sudo apt-get -qq install python3-yaml + + - name: Obfuscate _custom yaml + if: always() + shell: python + run: | + import yaml + + def obfuscate(d): + for k, v in d.items(): + if isinstance(v, dict): + obfuscate(v) + else: + d[k]='***' + return d + + with open('${{ inputs.plan_folder }}/_custom.yaml','r') as f: + data = yaml.safe_load(f) + if isinstance(data, dict): + if 'secrets' in data: + data['secrets']=obfuscate(data['secrets']) + with open('${{ inputs.plan_folder }}/_custom.yaml', 'w') as file: + yaml.dump(data, file) + with open('${{ inputs.plan_folder }}/_custom.yml', 'w') as file: + yaml.dump(data, file) + + - name: 'Create first testplan archive' + if: always() + id: begin_report + uses: OXID-eSales/github-actions/begin_report@v4 + with: + title: ${{ steps.ltp.outputs.finish_slack_title }} + prefix: '${{ steps.post_ltp.outputs.title }}' + repository: '${{ github.server_url }}/${{ github.repository }}' + job: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + testplan: '${{ inputs.testplan }}' + files: | + ${{ inputs.plan_folder}}/* + generated_testplan.yaml + generated_output.txt + generated_env.txt + load_testplan.log + debug: ${{ inputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ steps.post_ltp.outputs.title }}' + header: true + phase: install + priority: '001' + cached_object: ${{ steps.ltp.outputs.init_cache_name }} + debug: false + + outputs: + debug: ${{ steps.begin_report.outputs.debug }} + global_title: ${{ steps.post_ltp.outputs.title }} + # init variables + testplan: ${{ steps.consolidate_plans.outputs.testplan }} + init_cache_bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + init_cache_name: ${{ steps.ltp.outputs.init_cache_name }} + # prepare_shop variables + prepare_shop_add_services: ${{ steps.ltp.outputs.prepare_shop_add_services }} + prepare_shop_cache_bucket: ${{ steps.ltp.outputs.prepare_shop_cache_bucket }} + prepare_shop_cache_prefix: ${{ steps.ltp.outputs.prepare_shop_cache_prefix }} + prepare_shop_composer_file: ${{ steps.ltp.outputs.prepare_shop_composer_file }} + prepare_shop_composer_transform: ${{ steps.ltp.outputs.prepare_shop_composer_transform }} + prepare_shop_composer_backup: ${{ steps.ltp.outputs.prepare_shop_composer_backup }} + prepare_shop_composer_update: ${{ steps.ltp.outputs.prepare_shop_composer_update }} + prepare_shop_composer_update_options: ${{ steps.ltp.outputs.prepare_shop_composer_update_options}} + prepare_shop_composer_dev_ref: ${{ steps.ltp.outputs.prepare_shop_composer_dev_ref }} + prepare_shop_container_method: ${{ steps.ltp.outputs.prepare_shop_container_method }} + prepare_shop_container_name: ${{ steps.ltp.outputs.prepare_shop_container_name }} + prepare_shop_container_options: ${{ steps.ltp.outputs.prepare_shop_container_options }} + prepare_shop_custom_ini_error_reporting: ${{ steps.ltp.outputs.prepare_shop_custom_ini_error_reporting }} + prepare_shop_custom_ini_xdebug: ${{ steps.ltp.outputs.prepare_shop_custom_ini_xdebug }} + prepare_shop_docker_login: ${{ steps.ltp.outputs.prepare_shop_docker_login }} + prepare_shop_git_enterprise_ref: ${{ steps.ltp.outputs.prepare_shop_git_enterprise_ref }} + prepare_shop_git_sdk_ref: ${{ steps.ltp.outputs.prepare_shop_git_sdk_ref }} + prepare_shop_git_sdk_url: ${{ steps.ltp.outputs.prepare_shop_git_sdk_url }} + prepare_shop_git_shop_ref: ${{ steps.ltp.outputs.prepare_shop_git_shop_ref }} + prepare_shop_git_shop_url: ${{ steps.ltp.outputs.prepare_shop_git_shop_url }} + prepare_shop_matrix_mysql: ${{ steps.ltp.outputs.prepare_shop_matrix_mysql }} + prepare_shop_matrix_php: ${{ steps.ltp.outputs.prepare_shop_matrix_php }} + prepare_shop_max_parallel: ${{ steps.ltp.outputs.prepare_shop_max_parallel }} + # install_shop variables + install_shop_cache_bucket: ${{ steps.ltp.outputs.install_shop_cache_bucket }} + install_shop_cache_prefix: ${{ steps.ltp.outputs.install_shop_cache_prefix }} + install_shop_config_idebug: ${{ steps.ltp.outputs.install_shop_config_idebug }} + install_shop_container_method: ${{ steps.ltp.outputs.install_shop_container_method }} + install_shop_container_name: ${{ steps.ltp.outputs.install_shop_container_name }} + install_shop_container_options: ${{ steps.ltp.outputs.install_shop_container_options }} + install_shop_docker_login: ${{ steps.ltp.outputs.install_shop_docker_login }} + install_shop_is_enterprise: ${{ steps.ltp.outputs.install_shop_is_enterprise }} + install_shop_matrix_mysql: ${{ steps.ltp.outputs.install_shop_matrix_mysql }} + install_shop_matrix_php: ${{ steps.ltp.outputs.install_shop_matrix_php }} + install_shop_max_parallel: ${{ steps.ltp.outputs.install_shop_max_parallel }} + install_shop_custom_script: ${{ steps.ltp.outputs.install_shop_custom_script }} + install_shop_custom_script_container: ${{ steps.ltp.outputs.install_shop_custom_script_container }} + install_shop_output_artifact_prefix: ${{ steps.ltp.outputs.install_shop_output_artifact_prefix }} + install_shop_output_files: ${{ steps.ltp.outputs.install_shop_output_files }} + # install_module variables + install_module_cache_prefix: ${{ steps.ltp.outputs.install_module_cache_prefix }} + install_module_matrix_mysql: ${{ steps.ltp.outputs.install_module_matrix_mysql }} + install_module_matrix_php: ${{ steps.ltp.outputs.install_module_matrix_php }} + install_module_matrix_testplan: ${{ steps.ltp.outputs.install_module_matrix_testplan }} + install_module_max_parallel: ${{ steps.ltp.outputs.install_module_max_parallel }} + # phpunit variables + phpunit_matrix_mysql: ${{ steps.ltp.outputs.phpunit_matrix_mysql }} + phpunit_matrix_php: ${{ steps.ltp.outputs.phpunit_matrix_php }} + phpunit_matrix_testplan: ${{ steps.ltp.outputs.phpunit_matrix_testplan }} + phpunit_max_parallel: ${{ steps.ltp.outputs.phpunit_max_parallel }} + # codeception_tests variables + codeception_matrix_mysql: ${{ steps.ltp.outputs.codeception_matrix_mysql }} + codeception_matrix_php: ${{ steps.ltp.outputs.codeception_matrix_php }} + codeception_matrix_testplan: ${{ steps.ltp.outputs.codeception_matrix_testplan }} + codeception_max_parallel: ${{ steps.ltp.outputs.codeception_max_parallel }} + # runtest variables + runtest_matrix_mysql: ${{ steps.ltp.outputs.runtest_matrix_mysql }} + runtest_matrix_php: ${{ steps.ltp.outputs.runtest_matrix_php }} + runtest_matrix_testplan: ${{ steps.ltp.outputs.runtest_matrix_testplan }} + runtest_max_parallel: ${{ steps.ltp.outputs.runtest_max_parallel }} + # sonarcloud variables + sonarcloud_matrix_mysql: ${{ steps.ltp.outputs.sonarcloud_matrix_mysql }} + sonarcloud_matrix_php: ${{ steps.ltp.outputs.sonarcloud_matrix_php }} + sonarcloud_matrix_testplan: ${{ steps.ltp.outputs.sonarcloud_matrix_testplan }} + sonarcloud_max_parallel: ${{ steps.ltp.outputs.sonarcloud_max_parallel }} + # phpcs_tests variables + phpcs_tests_additional_options: ${{ steps.ltp.outputs.phpcs_tests_additional_options }} + phpcs_tests_cache_bucket: ${{ steps.ltp.outputs.phpcs_tests_cache_bucket }} + phpcs_tests_container_method: ${{ steps.ltp.outputs.phpcs_tests_container_method }} + phpcs_tests_container_name: ${{ steps.ltp.outputs.phpcs_tests_container_name }} + phpcs_tests_container_options: ${{ steps.ltp.outputs.phpcs_tests_container_options }} + phpcs_tests_docker_login: ${{ steps.ltp.outputs.phpcs_tests_docker_login }} + phpcs_tests_diff_only: ${{ steps.ltp.outputs.phpcs_tests_diff_only }} + phpcs_tests_failure_pattern: ${{ steps.ltp.outputs.phpcs_tests_failure_pattern }} + phpcs_tests_filter: ${{ steps.ltp.outputs.phpcs_tests_filter }} + phpcs_tests_git_ref: ${{ steps.ltp.outputs.phpcs_tests_git_ref }} + phpcs_tests_logfile_prefix: ${{ steps.ltp.outputs.phpcs_tests_logfile_prefix }} + phpcs_tests_output_prefix: ${{ steps.ltp.outputs.phpcs_tests_output_prefix }} + phpcs_tests_output_files: ${{ steps.ltp.outputs.phpcs_tests_output_files }} + phpcs_tests_matrix_mysql: ${{ steps.ltp.outputs.phpcs_tests_matrix_mysql }} + phpcs_tests_matrix_php: ${{ steps.ltp.outputs.phpcs_tests_matrix_php }} + phpcs_tests_max_parallel: ${{ steps.ltp.outputs.phpcs_tests_max_parallel }} + phpcs_tests_skip: ${{ steps.ltp.outputs.phpcs_tests_skip }} + # phpmd variables + phpmd_matrix_mysql: ${{ steps.ltp.outputs.phpmd_matrix_mysql }} + phpmd_matrix_php: ${{ steps.ltp.outputs.phpmd_matrix_php }} + phpmd_matrix_testplan: ${{ steps.ltp.outputs.phpmd_matrix_testplan }} + phpmd_max_parallel: ${{ steps.ltp.outputs.phpmd_max_parallel }} + # phpstan variables + phpstan_matrix_mysql: ${{ steps.ltp.outputs.phpstan_matrix_mysql }} + phpstan_matrix_php: ${{ steps.ltp.outputs.phpstan_matrix_php }} + phpstan_matrix_testplan: ${{ steps.ltp.outputs.phpstan_matrix_testplan }} + phpstan_max_parallel: ${{ steps.ltp.outputs.phpstan_max_parallel }} + # styles variables + styles_matrix_mysql: ${{ steps.ltp.outputs.styles_matrix_mysql }} + styles_matrix_php: ${{ steps.ltp.outputs.styles_matrix_php }} + styles_matrix_testplan: ${{ steps.ltp.outputs.styles_matrix_testplan }} + styles_max_parallel: ${{ steps.ltp.outputs.styles_max_parallel }} + # yamllint variables + yamllint_skip: ${{ steps.ltp.outputs.yamllint_skip }} + yamllint_file_or_dir: ${{ steps.ltp.outputs.yamllint_file_or_dir }} + yamllint_rules: ${{ steps.ltp.outputs.yamllint_rules }} + # actionlint variables + actionlint_skip: ${{ steps.ltp.outputs.actionlint_skip }} + # finish variables + finish_matrix_mysql: ${{ steps.ltp.outputs.finish_matrix_mysql }} + finish_matrix_php: ${{ steps.ltp.outputs.finish_matrix_php }} + finish_skip: ${{ steps.ltp.outputs.finish_skip }} + finish_slack_title: ${{ steps.ltp.outputs.finish_slack_title }} + finish_slack_compact: ${{ steps.ltp.outputs.finish_slack_compact }} + + prepare_shop: + needs: init + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.prepare_shop_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.prepare_shop_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.prepare_shop_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + + steps: + - name: 'Prepare Shop' + id: prepare_shop + uses: 'OXID-eSales/github-actions/prepare_shop@v4' + with: + container_name: ${{ needs.init.outputs.prepare_shop_container_name }} + container_options: ${{ needs.init.outputs.prepare_shop_container_options }} + container_method: ${{ needs.init.outputs.prepare_shop_container_method }} + docker_login: ${{ needs.init.outputs.prepare_shop_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + git_sdk_url: ${{ needs.init.outputs.prepare_shop_git_sdk_url }} + git_sdk_ref: ${{ needs.init.outputs.prepare_shop_git_sdk_ref }} + git_shop_url: ${{ needs.init.outputs.prepare_shop_git_shop_url }} + git_shop_ref: ${{ needs.init.outputs.prepare_shop_git_shop_ref }} + git_enterprise_ref: ${{ needs.init.outputs.prepare_shop_git_enterprise_ref }} + github_event_name: ${{ github.event_name }} + github_event_number: ${{ github.event.number }} + github_base_ref: ${{ github.base_ref }} + github_ref_name: ${{ github.ref_name }} + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + custom_ini_error_reporting: ${{ needs.init.outputs.prepare_shop_custom_ini_error_reporting }} + custom_ini_xdebug: ${{ needs.init.outputs.prepare_shop_custom_ini_xdebug }} + add_services: ${{ needs.init.outputs.prepare_shop_add_services }} + composer_file: ${{ needs.init.outputs.prepare_shop_composer_file }} + composer_transform: ${{ needs.init.outputs.prepare_shop_composer_transform}} + composer_backup: ${{ needs.init.outputs.prepare_shop_composer_backup}} + composer_update: ${{ needs.init.outputs.prepare_shop_composer_update}} + composer_update_options: ${{ needs.init.outputs.prepare_shop_composer_update_options}} + composer_dev_ref: ${{ needs.init.outputs.prepare_shop_composer_dev_ref}} + enterprise_github_token: ${{ secrets.enterprise_github_token || github.token }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Cache current installation + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ needs.init.outputs.prepare_shop_cache_bucket }} + + - name: Debug cache current installation + if: ${{ inputs.debug }} + shell: bash + run: | + # prepare_shop: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + CACHE_NAME='${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '010' + phase: install + job: prepare_shop + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + cached_object: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + debug: ${{ inputs.debug }} + + install_shop: + needs: ['init', 'prepare_shop'] + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.install_shop_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.install_shop_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.install_shop_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + cache_bucket: ${{ needs.init.outputs.install_shop_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ needs.init.outputs.install_shop_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Install shop' + id: install_shop + uses: 'OXID-eSales/github-actions/install_shop@v4' + with: + container_name: ${{ needs.init.outputs.install_shop_container_name }} + container_options: ${{ needs.init.outputs.install_shop_container_options }} + container_method: ${{ needs.init.outputs.install_shop_container_method }} + is_enterprise: ${{ needs.init.outputs.install_shop_is_enterprise }} + config_idebug: ${{ needs.init.outputs.install_shop_config_idebug }} + debug: ${{ needs.init.outputs.debug }} + + - name: Write files list + if: always() + shell: bash + run: | + # install_shop: Write files list + find . >files.txt + # Compensate for multiline problems + { + echo 'ARTIFACT_PATHS<> "${GITHUB_ENV}" + + - name: Upload configuration artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: 'configs-install_shop-${{needs.init.outputs.global_title}}-PHP${{ matrix.php }}-MYSQL${{ matrix.mysql }}' + path: |- + ${{ env.ARTIFACT_PATHS }} + + - name: Run custom scripts + if: ${{ needs.init.outputs.install_shop_custom_script != '' || needs.init.outputs.install_shop_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ needs.init.outputs.install_shop_container_name }} + container_options: ${{ needs.init.outputs.install_shop_container_options }} + container_method: ${{ needs.init.outputs.install_shop_container_method }} + custom_script: ${{ needs.init.outputs.install_shop_custom_script }} + custom_script_container: ${{ needs.init.outputs.install_shop_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Debug cache current installation + if: ${{ inputs.debug }} + shell: bash + run: | + # prepare_shop: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + CACHE_NAME='${{ needs.init.outputs.install_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: Cache current installation + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ needs.init.outputs.install_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ needs.init.outputs.install_shop_cache_bucket }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '020' + phase: install + job: install_shop + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + cached_object: '${{ needs.init.outputs.install_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + debug: ${{ inputs.debug }} + + install_module: + needs: ['init', 'install_shop'] + strategy: + matrix: + testplan: ${{ fromJSON(needs.init.outputs.install_module_matrix_testplan) }} + php: ${{ fromJSON(needs.init.outputs.install_module_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.install_module_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.install_module_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + if: ${{ matrix.testplan != 'skip' }} + id: install_module_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: ${{needs.init.outputs.global_title}} + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: install_module_testplan + if: ${{ matrix.testplan != 'skip' }} + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.install_module_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + if: ${{ matrix.testplan != 'skip' }} + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + # yamllint disable-line rule:line-length + cached_shop: '${{ steps.install_module_testplan.outputs.install_module_load_shop}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + cache_bucket: ${{ steps.install_module_testplan.outputs.install_module_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.install_module_testplan.outputs.install_module_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: Checkout module + id: checkout_module + if: ${{ matrix.testplan != 'skip' }} + run: | + AUTH="oxidci:${{ secrets.enterprise_github_token || github.token }}" + + if [[ '${{ github.event_name }}' == 'pull_request' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ce' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ee' ]]; then + echo -e "\033[0;35mHandling the pull request\033[0m" + git clone --depth 2 \ + https://${AUTH}@github.com/${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch ${{ github.base_ref }} \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' fetch origin \ + refs/pull/${{ github.event.number }}/head:pr_${{ github.event.number }} + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' checkout pr_${{ github.event.number }} + echo "module_ref=pr_${{ github.event.number }}" >>"${GITHUB_OUTPUT}" + else + MODULE_REF="$(echo "${{ steps.install_module_testplan.outputs.install_module_git_module_ref }}"|sed -e 's|^dev-||')" + git clone --depth 2 \ + https://${AUTH}@github.com/${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch "${MODULE_REF}" \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + echo "module_ref=${MODULE_REF}" >>"${GITHUB_OUTPUT}" + fi + find . -type f >files.txt + if [ '${{ inputs.debug }}' == 'true' ]; then + cat >>debug/debug.sh <<'EODS' + banner "Checkout module" + # Note: we use ssh here, the workflow uses https and the runtime token or enterprise token + if [[ '${{ github.event_name }}' == 'pull_request' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ce' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ee' ]]; then + echo -e "\033[0;35mHandling the pull request\033[0m" + git clone --depth 2 \ + git@github.com:${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch ${{ github.base_ref }} \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' fetch origin \ + refs/pull/${{ github.event.number }}/head:pr_${{ github.event.number }} + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' checkout pr_${{ github.event.number }} + else + MODULE_REF="$(echo "${{ steps.install_module_testplan.outputs.install_module_git_module_ref }}"|sed -e 's|^dev-||')" + git clone --depth 2 \ + git@github.com:${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch "${MODULE_REF}" \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + fi + find . -type f >files.txt + EODS + fi + + - name: 'Modify composer.json' + if: ${{ steps.install_module_testplan.outputs.install_module_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}/composer.json' + backup: true + transform: | + ${{ steps.install_module_testplan.outputs.install_module_composer_transform }} + update: ${{ steps.install_module_testplan.outputs.install_module_composer_update }} + update_options: ${{ steps.install_module_testplan.outputs.install_module_composer_update_options }} + container_name: ${{ steps.install_module_testplan.outputs.install_module_container_name }} + container_options: ${{ steps.install_module_testplan.outputs.install_module_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Install module + if: ${{ matrix.testplan != 'skip' }} + id: install_module + uses: 'OXID-eSales/github-actions/install_module@v4' + with: + container_name: ${{ steps.install_module_testplan.outputs.install_module_container_name }} + container_options: ${{ steps.install_module_testplan.outputs.install_module_container_options }} + container_method: ${{ steps.install_module_testplan.outputs.install_module_container_method }} + package_name: ${{ steps.install_module_testplan.outputs.install_module_package_name }} + module_ids: ${{ steps.install_module_testplan.outputs.install_module_ids }} + module_path: 'dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + activate: ${{ steps.install_module_testplan.outputs.install_module_activate }} + git_module_url: ${{ steps.install_module_testplan.outputs.install_module_git_module_url }} + git_module_ref: ${{ steps.checkout_module.outputs.module_ref }} + output_files: ${{ steps.install_module_testplan.outputs.install_module_output_files }} + # yamllint disable-line rule:line-length + output_artifact: '${{steps.install_module_testplan.outputs.install_module_output_artifact_prefix}}-${{steps.install_module_testplan.outputs.install_module_ids}}-${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + enterprise_github_token: ${{ secrets.enterprise_github_token || github.token}} + debug: ${{ needs.init.outputs.debug }} + + - name: Run custom scripts + # yamllint disable-line rule:line-length + if: ${{ matrix.testplan != 'skip' && (steps.install_module_testplan.outputs.install_module_custom_script != '' || steps.install_module_testplan.outputs.install_module_custom_script_container != '') }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.install_module_testplan.outputs.install_module_container_name }} + container_options: ${{ steps.install_module_testplan.outputs.install_module_container_options }} + container_method: ${{ steps.install_module_testplan.outputs.install_module_container_method }} + custom_script: ${{ steps.install_module_testplan.outputs.install_module_custom_script }} + custom_script_container: ${{ steps.install_module_testplan.outputs.install_module_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() && matrix.testplan != 'skip' }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Cache current installation + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ steps.install_module_testplan.outputs.install_module_cache_prefix}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.install_module_testplan.outputs.install_module_cache_bucket }} + + - name: Debug cache current installation + if: ${{ matrix.testplan != 'skip' && inputs.debug }} + shell: bash + run: | + # prepare_shop: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + CACHE_NAME='${{ steps.install_module_testplan.outputs.install_module_cache_prefix}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: 'Write Report' + if: ${{ always() && matrix.testplan != 'skip' }} + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '030' + phase: install + job: install_module + title: ${{ steps.install_module_testplan.outputs.install_module_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + cached_object: '${{ steps.install_module_testplan.outputs.install_module_cache_prefix}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + debug: ${{ inputs.debug }} + + - name: 'Write Report' + if: ${{ always() && matrix.testplan == 'skip' }} + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '030' + phase: install + job: install_module + title: 'none' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: 'skipped' + debug: ${{ inputs.debug }} + + begin_test_phase: + needs: ['init', 'install_module'] + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + header: true + priority: '100' + phase: test + debug: false + + phpunit: + needs: ['init', 'install_module', 'begin_test_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.phpunit_matrix_testplan != '' && needs.init.outputs.phpunit_matrix_testplan != 'skip' && needs.init.outputs.phpunit_matrix_testplan != 'none' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpunit_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpunit_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.phpunit_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpunit_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: phpunit_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: phpunit_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.phpunit_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.phpunit_testplan.outputs.phpunit_load_shop}}_${{ steps.phpunit_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.phpunit_testplan.outputs.phpunit_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.phpunit_testplan.outputs.phpunit_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: Run custom scripts + if: ${{ steps.phpunit_testplan.outputs.phpunit_custom_script != '' || steps.phpunit_testplan.outputs.phpunit_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.phpunit_testplan.outputs.phpunit_container_name }} + container_options: ${{ steps.phpunit_testplan.outputs.phpunit_container_options }} + container_method: ${{ steps.phpunit_testplan.outputs.phpunit_container_method }} + custom_script: ${{ steps.phpunit_testplan.outputs.phpunit_custom_script }} + custom_script_container: ${{ steps.phpunit_testplan.outputs.phpunit_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpunit tests' + id: phpunit_run + uses: 'OXID-eSales/github-actions/phpunit@v4' + with: + container_name: ${{ steps.phpunit_testplan.outputs.phpunit_container_name }} + container_options: ${{ steps.phpunit_testplan.outputs.phpunit_container_options }} + container_method: ${{ steps.phpunit_testplan.outputs.phpunit_container_method }} + configuration: ${{ steps.phpunit_testplan.outputs.phpunit_configuration }} + test: ${{ steps.phpunit_testplan.outputs.phpunit_test }} + additional_options: ${{ steps.phpunit_testplan.outputs.phpunit_additional_options }} + # yamllint disable-line rule:line-length + logfile: ${{steps.phpunit_testplan.outputs.phpunit_logfile_prefix}}-${{ steps.phpunit_testplan.outputs.phpunit_title }}-${{steps.phpunit_testplan_name.outputs.matrix_suffix}}.txt + output_files: ${{ steps.phpunit_testplan.outputs.phpunit_output_files }} + output_artifact: ${{steps.phpunit_testplan.outputs.phpunit_output_prefix}}-${{steps.phpunit_testplan_name.outputs.matrix_suffix}} + coverage_path: ${{ steps.phpunit_testplan.outputs.phpunit_coverage_path }} + coverage_artifact: ${{ steps.phpunit_testplan.outputs.phpunit_coverage_prefix }}-${{steps.phpunit_testplan_name.outputs.matrix_suffix}} + failure_pattern: ${{ steps.phpunit_testplan.outputs.phpunit_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '110' + phase: test + job: phpunit + title: ${{ steps.phpunit_testplan.outputs.phpunit_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + codeception: + needs: ['init', 'install_module', 'begin_test_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.codeception_matrix_testplan != '' && needs.init.outputs.codeception_matrix_testplan != 'none' && needs.init.outputs.codeception_matrix_testplan != 'skip' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.codeception_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.codeception_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.codeception_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.codeception_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: codeception_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: codeception_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.codeception_testplan_name.outputs.testplan}}' + set_output: true + set_env: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: Run pre-script + id: pre_script + shell: bash + run: | + # codeception: Run pre-script + ${{ needs.init.outputs.debug }} + ${{ steps.codeception_testplan.outputs.codeception_pre_script }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.codeception_testplan.outputs.codeception_load_shop}}_${{ steps.codeception_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.codeception_testplan.outputs.codeception_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.codeception_testplan.outputs.codeception_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + wait_for_selenium: ${{ steps.codeception_testplan.outputs.codeception_wait_for_selenium }} + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.codeception_testplan.outputs.codeception_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.codeception_testplan.outputs.codeception_composer_file }}' + backup: true + transform: | + ${{ steps.codeception_testplan.outputs.codeception_composer_transform }} + update: ${{ steps.codeception_testplan.outputs.codeception_composer_update }} + update_options: ${{ steps.codeception_testplan.outputs.codeception_composer_update_options }} + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + container_options: ${{ steps.codeception_testplan.outputs.codeception_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + # yamllint disable-line rule:line-length + if: ${{ steps.codeception_testplan.outputs.codeception_custom_script != '' || steps.codeception_testplan.outputs.codeception_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + container_options: ${{ steps.codeception_testplan.outputs.codeception_container_options }} + container_method: ${{ steps.codeception_testplan.outputs.codeception_container_method }} + custom_script: ${{ steps.codeception_testplan.outputs.codeception_custom_script }} + custom_script_container: ${{ steps.codeception_testplan.outputs.codeception_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run codeception tests' + id: codeception_run + uses: 'OXID-eSales/github-actions/codeception@v4' + with: + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + container_options: '${{ steps.codeception_testplan.outputs.codeception_container_options }} ${{ steps.pre_script.outputs.container_options }}' + container_method: ${{ steps.codeception_testplan.outputs.codeception_container_method }} + build: ${{ steps.codeception_testplan.outputs.codeception_build }} + configuration: ${{ steps.codeception_testplan.outputs.codeception_configuration }} + suite: ${{ steps.codeception_testplan.outputs.codeception_suite }} + test: ${{ steps.codeception_testplan.outputs.codeception_test }} + additional_options: ${{ steps.codeception_testplan.outputs.codeception_additional_options }} + build_additional_options: ${{ steps.codeception_testplan.outputs.codeception_build_additional_options }} + # yamllint disable-line rule:line-length + logfile: ${{steps.codeception_testplan.outputs.codeception_logfile_prefix}}-${{steps.codeception_testplan.outputs.codeception_title}}-${{steps.codeception_testplan_name.outputs.matrix_suffix}}.txt + output_files: ${{ steps.codeception_testplan.outputs.codeception_output_files }} + output_artifact: ${{steps.codeception_testplan.outputs.codeception_output_prefix}}-${{steps.codeception_testplan_name.outputs.matrix_suffix}} + coverage_path: ${{ steps.codeception_testplan.outputs.codeception_coverage_path }} + coverage_artifact: ${{ steps.codeception_testplan.outputs.codeception_coverage_prefix }}-${{steps.codeception_testplan_name.outputs.matrix_suffix}} + failure_pattern: ${{ steps.codeception_testplan.outputs.codeception_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '120' + phase: test + job: codeception + title: ${{ steps.codeception_testplan.outputs.codeception_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + runtest: + needs: ['init', 'install_module', 'begin_test_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.runtest_matrix_testplan != '' && needs.init.outputs.runtest_matrix_testplan != 'none' && needs.init.outputs.runtest_matrix_testplan != 'skip' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.runtest_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.runtest_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.runtest_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.runtest_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: runtest_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: runtest_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.runtest_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: Set swap space + if: ${{ inputs.runs_on == '"ubuntu-latest"' }} + uses: actionhippie/swap-space@v1 + with: + size: 10G + path: swapfile + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.runtest_testplan.outputs.runtest_load_shop}}_${{ steps.runtest_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.runtest_testplan.outputs.runtest_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.runtest_testplan.outputs.runtest_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.runtest_testplan.outputs.runtest_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.runtest_testplan.outputs.runtest_composer_file }}' + backup: true + transform: | + ${{ steps.runtest_testplan.outputs.runtest_composer_transform }} + update: ${{ steps.runtest_testplan.outputs.runtest_composer_update }} + update_options: ${{ steps.runtest_testplan.outputs.runtest_composer_update_options }} + container_name: ${{ steps.runtest_testplan.outputs.runtest_container_name }} + container_options: ${{ steps.runtest_testplan.outputs.runtest_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Copy config file + run: | + cp source/vendor/oxid-esales/testing-library/test_config.yml.dist source/test_config.yml + ${{ needs.init.outputs.debug }} + + + - name: Run custom scripts + if: ${{ steps.runtest_testplan.outputs.runtest_custom_script != '' || steps.runtest_testplan.outputs.runtest_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.runtest_testplan.outputs.runtest_container_name }} + container_options: ${{ steps.runtest_testplan.outputs.runtest_container_options }} + container_method: ${{ steps.runtest_testplan.outputs.runtest_container_method }} + custom_script: ${{ steps.runtest_testplan.outputs.runtest_custom_script }} + custom_script_container: ${{ steps.runtest_testplan.outputs.runtest_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run tests' + id: runtest_run + uses: 'OXID-eSales/github-actions/runtests@v4' + with: + container_name: ${{ steps.runtest_testplan.outputs.runtest_container_name }} + container_options: ${{ steps.runtest_testplan.outputs.runtest_container_options }} + container_method: ${{ steps.runtest_testplan.outputs.runtest_container_method }} + test: ${{ steps.runtest_testplan.outputs.runtest_test }} + additional_options: ${{ steps.runtest_testplan.outputs.runtest_additional_options }} + # yamllint disable-line rule:line-length + logfile: ${{ steps.runtest_testplan.outputs.runtest_logfile_prefix}}-${{ steps.runtest_testplan.outputs.runtest_title}}-${{ steps.runtest_testplan_name.outputs.matrix_suffix }}.txt + output_files: ${{ steps.runtest_testplan.outputs.runtest_output_files }} + output_artifact: ${{ steps.runtest_testplan.outputs.runtest_output_prefix }}-${{ steps.runtest_testplan_name.outputs.matrix_suffix }} + coverage_path: ${{ steps.runtest_testplan.outputs.runtest_coverage_path }} + coverage_artifact: ${{ steps.runtest_testplan.outputs.runtest_coverage_prefix }}-${{ steps.runtest_testplan_name.outputs.matrix_suffix }} + failure_pattern: ${{ steps.runtest_testplan.outputs.runtest_failure_pattern }} + reset_shop: ${{ steps.runtest_testplan.outputs.runtest_reset_shop }} + reset_shop_binary: ${{ steps.runtest_testplan.outputs.runtest_reset_shop_binary }} + runtests_binary: ${{ steps.runtest_testplan.outputs.runtest_runtests_binary }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '130' + phase: test + job: runtest + title: ${{ steps.runtest_testplan.outputs.runtest_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + begin_report_phase: + needs: ['init', 'install_module'] + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + header: true + priority: '200' + phase: report + debug: false + + phpmd: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ needs.init.outputs.phpmd_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpmd_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpmd_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.phpmd_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpmd_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: phpmd_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: phpmd_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.phpmd_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.phpmd_testplan.outputs.phpmd_load_shop}}_${{ steps.phpmd_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.phpmd_testplan.outputs.phpmd_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.phpmd_testplan.outputs.phpmd_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.phpmd_testplan.outputs.phpmd_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.phpmd_testplan.outputs.phpmd_composer_file }}' + backup: true + transform: | + ${{ steps.phpmd_testplan.outputs.phpmd_composer_transform }} + update: ${{ steps.phpmd_testplan.outputs.phpmd_composer_update }} + update_options: ${{ steps.phpmd_testplan.outputs.phpmd_composer_update_options }} + container_name: ${{ steps.phpmd_testplan.outputs.phpmd_container_name }} + container_options: ${{ steps.phpmd_testplan.outputs.phpmd_container_options }} + container_method: ${{ steps.phpmd_testplan.outputs.phpmd_container_method }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + if: ${{ steps.phpmd_testplan.outputs.phpmd_custom_script != '' || steps.phpmd_testplan.outputs.phpmd_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.phpmd_testplan.outputs.phpmd_container_name }} + container_options: ${{ steps.phpmd_testplan.outputs.phpmd_container_options }} + container_method: ${{ steps.phpmd_testplan.outputs.phpmd_container_method }} + custom_script: ${{ steps.phpmd_testplan.outputs.phpmd_custom_script }} + custom_script_container: ${{ steps.phpmd_testplan.outputs.phpmd_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpmd check' + uses: 'OXID-eSales/github-actions/phpmd@v4' + with: + source_path: ${{ steps.phpmd_testplan.outputs.phpmd_source_path }} + report_path: ${{ steps.phpmd_testplan.outputs.phpmd_report_path }} + config: ${{ steps.phpmd_testplan.outputs.phpmd_config }} + baseline_file: ${{ steps.phpmd_testplan.outputs.phpmd_baseline_file }} + additional_options: ${{ steps.phpmd_testplan.outputs.phpmd_additional_options }} + title: ${{ steps.phpmd_testplan.outputs.phpmd_title }} + verbose: ${{ steps.phpmd_testplan.outputs.phpmd_verbose }} + generate_baseline: ${{ steps.phpmd_testplan.outputs.phpmd_generate_baseline }} + container_name: ${{ steps.phpmd_testplan.outputs.phpmd_container_name }} + container_options: ${{ steps.phpmd_testplan.outputs.phpmd_container_options }} + container_method: ${{ steps.phpmd_testplan.outputs.phpmd_container_method }} + output_artifact: ${{ steps.phpmd_testplan.outputs.phpmd_output_prefix}}_${{ steps.phpmd_testplan_name.outputs.matrix_suffix }} + failure_pattern: ${{ steps.phpmd_testplan.outputs.phpmd_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '210' + phase: report + job: phpmd + title: '${{ steps.phpmd_testplan.outputs.phpmd_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + phpstan: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ needs.init.outputs.phpstan_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpstan_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpstan_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.phpstan_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpstan_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: phpstan_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: phpstan_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.phpstan_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.phpstan_testplan.outputs.phpstan_load_shop}}_${{ steps.phpstan_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.phpstan_testplan.outputs.phpstan_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.phpstan_testplan.outputs.phpstan_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.phpstan_testplan.outputs.phpstan_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.phpstan_testplan.outputs.phpstan_composer_file }}' + backup: true + transform: | + ${{ steps.phpstan_testplan.outputs.phpstan_composer_transform }} + update: ${{ steps.phpstan_testplan.outputs.phpstan_composer_update }} + update_options: ${{ steps.phpstan_testplan.outputs.phpstan_composer_update_options }} + container_name: ${{ steps.phpstan_testplan.outputs.phpstan_container_name }} + container_options: ${{ steps.phpstan_testplan.outputs.phpstan_container_options }} + container_method: ${{ steps.phpstan_testplan.outputs.phpstan_container_method }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + if: ${{ steps.phpstan_testplan.outputs.phpstan_custom_script != '' || steps.phpstan_testplan.outputs.phpstan_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.phpstan_testplan.outputs.phpstan_container_name }} + container_options: ${{ steps.phpstan_testplan.outputs.phpstan_container_options }} + container_method: ${{ steps.phpstan_testplan.outputs.phpstan_container_method }} + custom_script: ${{ steps.phpstan_testplan.outputs.phpstan_custom_script }} + custom_script_container: ${{ steps.phpstan_testplan.outputs.phpstan_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpstan check' + uses: 'OXID-eSales/github-actions/phpstan@v4' + with: + source_path: ${{ steps.phpstan_testplan.outputs.phpstan_source_path }} + report_path: ${{ steps.phpstan_testplan.outputs.phpstan_report_path }} + neon_file: ${{ steps.phpstan_testplan.outputs.phpstan_neon_file }} + additional_options: ${{ steps.phpstan_testplan.outputs.phpstan_additional_options }} + title: ${{ steps.phpstan_testplan.outputs.phpstan_title }} + verbose: ${{ steps.phpstan_testplan.outputs.phpstan_verbose }} + generate_baseline: ${{ steps.phpstan_testplan.outputs.phpstan_generate_baseline }} + container_name: ${{ steps.phpstan_testplan.outputs.phpstan_container_name }} + container_options: ${{ steps.phpstan_testplan.outputs.phpstan_container_options }} + container_method: ${{ steps.phpstan_testplan.outputs.phpstan_container_method }} + output_artifact: ${{ steps.phpstan_testplan.outputs.phpstan_output_prefix}}_${{ steps.phpstan_testplan_name.outputs.matrix_suffix }} + failure_pattern: ${{ steps.phpstan_testplan.outputs.phpstan_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '220' + phase: report + job: phpstan + title: '${{ steps.phpstan_testplan.outputs.phpstan_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + phpcs_tests: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ always() && needs.init.outputs.phpcs_tests_skip != 'true' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpcs_tests_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpcs_tests_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpcs_tests_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ needs.init.outputs.install_module_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + cache_bucket: ${{ needs.init.outputs.phpcs_tests_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ needs.init.outputs.phpcs_tests_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpcs tests' + uses: 'OXID-eSales/github-actions/phpcs@v4' + with: + container_name: ${{ needs.init.outputs.phpcs_tests_container_name }} + container_options: ${{ needs.init.outputs.phpcs_tests_container_options }} + container_method: ${{ needs.init.outputs.phpcs_tests_container_method }} + git_ref: ${{ needs.init.outputs.phpcs_tests_git_ref }} + diff_only: ${{ needs.init.outputs.phpcs_tests_diff_only}} + filter: ${{ needs.init.outputs.phpcs_tests_filter}} + additional_options: ${{ needs.init.outputs.phpcs_tests_additional_options }} + logfile: phpcs-PHP${{ matrix.php }}_MYSQL${{ matrix.mysql }}_codesniff_log.txt + output_artifact: ${{ needs.init.outputs.phpcs_tests_output_prefix }}-${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}} + output_files: ${{ needs.init.outputs.phpcs_tests_output_files }} + failure_pattern: ${{ needs.init.outputs.phpcs_tests_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '230' + phase: report + job: phpcs + title: 'default' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + sonarcloud: + needs: ['init', 'install_module', 'phpunit', 'codeception', 'begin_report_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.sonarcloud_matrix_testplan != '' && needs.init.outputs.sonarcloud_matrix_testplan != 'none' && needs.init.outputs.sonarcloud_matrix_testplan != 'skip' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.sonarcloud_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + steps: + - name: Warn if sonarcloud secret is missing + if: ${{ env.SONAR_TOKEN == '' }} + run: | + echo "::warning title=Missing secrets::Please set the repository secrets SONAR_TOKEN to run sonarcloud scans" + + - name: Load cached testplan + id: sonarcloud_testplan_name + if: ${{ env.SONAR_TOKEN != '' }} + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: sonarcloud_testplan + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.sonarcloud_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: Checkout shop + if: ${{ env.SONAR_TOKEN != '' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_repository }}' + ref: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_ref }}' + token: ${{ secrets.enterprise_github_token || github.token }} + + - name: 'SonarCloud Scan' + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'OXID-eSales/github-actions/sonarcloud@v4' + with: + coverage_artifact: 'coverage-reports-*-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' + output_artifact: 'coverage-reports-${{ needs.init.outputs.global_title }}' + target_branch: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_target_branch }} + strip_path: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_strip_path }} + github_ref_name: ${{ github.ref_name }} + sonarcloud_organization: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_organization }} + sonarcloud_project_key: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_key }} + sonarcloud_project_name: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_name }} + sonarcloud_parameters: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_parameters }} + sonar_token: ${{ secrets.SONAR_TOKEN }} + github_token: ${{ github.token }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + job: sonarcloud + title: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + styles: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ needs.init.outputs.styles_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.styles_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.styles_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.styles_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.styles_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: styles_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: styles_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.styles_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.styles_testplan.outputs.styles_load_shop}}_${{ steps.styles_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.styles_testplan.outputs.styles_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.styles_testplan.outputs.styles_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: Update the github token + run: | + # Update github token + ${{ inputs.debug }} + docker compose exec -T \ + ${{ steps.styles_testplan.outputs.styles_container_options }} \ + ${{ steps.styles_testplan.outputs.styles_container_name }} \ + composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}" + + - name: 'Modify composer.json' + if: ${{ steps.styles_testplan.outputs.styles_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/dev-packages/${{ steps.styles_testplan.outputs.styles_path }}/composer.json' + backup: true + transform: | + ${{ steps.styles_testplan.outputs.styles_composer_transform }} + update: ${{ steps.styles_testplan.outputs.styles_composer_update }} + update_options: ${{ steps.styles_testplan.outputs.styles_composer_update_options }} + container_name: ${{ steps.styles_testplan.outputs.styles_container_name }} + container_options: ${{ steps.styles_testplan.outputs.styles_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + if: ${{ steps.styles_testplan.outputs.styles_custom_script != '' || steps.styles_testplan.outputs.styles_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.styles_testplan.outputs.styles_container_name }} + container_options: ${{ steps.styles_testplan.outputs.styles_container_options }} + container_method: ${{ steps.styles_testplan.outputs.styles_container_method }} + custom_script: ${{ steps.styles_testplan.outputs.styles_custom_script }} + custom_script_container: ${{ steps.styles_testplan.outputs.styles_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run styles check' + uses: 'OXID-eSales/github-actions/styles@v4' + with: + path: ${{ steps.styles_testplan.outputs.styles_path }} + module_ids: ${{ steps.styles_testplan.outputs.styles_module_ids }} + install_options: ${{ steps.styles_testplan.outputs.styles_install_options }} + container_name: ${{ steps.styles_testplan.outputs.styles_container_name }} + container_options: ${{ steps.styles_testplan.outputs.styles_container_options }} + container_method: ${{ steps.styles_testplan.outputs.styles_container_method }} + output_files: ${{ steps.styles_testplan.outputs.styles_output_files }} + output_artifact: ${{ steps.styles_testplan.outputs.styles_output_prefix}}_${{ steps.styles_testplan_name.outputs.matrix_suffix }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '250' + phase: report + job: styles + title: '${{ steps.styles_testplan.outputs.styles_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + yamllint: + needs: ['init', 'begin_report_phase'] + if: ${{ always() && needs.init.outputs.yamllint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Lint yaml files + id: yamllint + uses: OXID-eSales/github-actions/yamllint@v4 + with: + file_or_dir: ${{ needs.init.outputs.yamllint_file_or_dir }} + config_data: ${{ needs.init.outputs.yamllint_rules }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write yamllint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + title: '' + job: 'yamllint' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + + actionlint: + needs: ['init', 'begin_report_phase'] + if: ${{ always() && needs.init.outputs.actionlint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Install npm on private runner + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + run: | + NPM=$(type -p 'npm'||true) + 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 python3-venv + fi + + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Run actionlint + id: actionlint + uses: raven-actions/actionlint@v2 + + - name: actionlint Summary + if: always() + run: | + echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}" + echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}" + echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code" + echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'" + echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors" + echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files" + echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}" + + - name: 'Write actionlint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '250' + phase: report + job: 'actionlint' + title: '' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + + finish: + if: ${{ always() && needs.init.outputs.finish_skip != 'true' }} + needs: + - init + - prepare_shop + - install_shop + - install_module + - phpunit + - codeception + - runtest + - sonarcloud + - phpcs_tests + - phpmd + - phpstan + - styles + - yamllint + - actionlint + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + SLACK_WEBHOOK: "${{ secrets.SLACK_WEBHOOK_URL }}" + steps: + - name: 'Generate report' + id: generate_report + uses: 'OXID-eSales/github-actions/generate_report@v4' + with: + prefix: '${{ needs.init.outputs.global_title }}' + slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + title: '${{ needs.init.outputs.finish_slack_title }}' + compact: '${{ needs.init.outputs.finish_slack_compact }}' + debug: ${{ inputs.debug }} + + - name: 'Checkout the repo for cleanup' + uses: actions/checkout@v4 + with: + path: repo + + - name: 'Clean Cache' + # if: ${{ steps.generate_report.outputs.overall_status == 'success' }} + uses: 'OXID-eSales/github-actions/clean_cache@v4' + env: + GH_TOKEN: ${{ github.token }} + with: + path: repo + runs_on: ${{ inputs.runs_on }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_objects: | + ${{ steps.generate_report.outputs.cache_objects }} + debug: ${{ needs.init.outputs.debug }} diff --git a/.github/workflows/call-universal_test_workflow.yml.backup b/.github/workflows/call-universal_test_workflow.yml.backup new file mode 100644 index 00000000..ed85c590 --- /dev/null +++ b/.github/workflows/call-universal_test_workflow.yml.backup @@ -0,0 +1,1795 @@ +name: universal_test_workflow +# This workflow loads a base testplan, creates cached shop instances and runs +# phpunit, codeception and runtest based tests as well as code scans +# and sonarcloud reports +# +# yamllint disable-line rule:truthy +on: + workflow_call: + inputs: + testplan: + type: string + description: 'Testplan to run' + required: true + runs_on: + type: string + description: 'JSON string/array describing the runner' + required: true + defaults: + type: string + description: 'Which ref do we want to use for the plan defaults' + required: false + default: 'v3' + plan_folder: + type: string + description: 'Folder containing the test plans' + required: false + default: 'tests/github_actions' + default_plan_folder: + type: string + description: 'Folder containing the test plan templates' + required: false + default: '.github/oxid-esales/defaults' + debug: + type: boolean + description: 'Enable debugging' + default: true + required: false + custom_testplan_yaml: + type: string + description: 'Content of ~/oxid-esales/_custom.yaml' + default: '' + required: false + + secrets: + DOCKER_HUB_USER: + # description: 'user for the docker login' + required: false + DOCKER_HUB_TOKEN: + # description: 'Token for the docker login' + required: false + CACHE_ENDPOINT: + # description: 'Endpoint for tespkg/actions-cache@v1' + required: false # only for ee + CACHE_ACCESS_KEY: + # description: 'Access key for tespkg/actions-cache@v1' + required: false # only for ee + CACHE_SECRET_KEY: + # description: 'Secret key for tespkg/actions-cache@v1' + required: false # only for ee + enterprise_github_token: + # description: 'OAuth token to access enterprise repos' + required: false + SONAR_TOKEN: + # description: Token for sonarcloud access + required: false + SLACK_WEBHOOK_URL: + required: false + # description: Webhook for posting to SLACK + +jobs: + init: + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Checkout testplan defaults' + uses: actions/checkout@v4 + with: + repository: 'OXID-eSales/github-actions' + ref: '${{ inputs.defaults }}' + path: 'defaults' + sparse-checkout: '${{ inputs.default_plan_folder }}' + + - name: 'Checkout testplans' + uses: actions/checkout@v4 + with: + sparse-checkout: | + ${{ inputs.plan_folder}} + composer.json + path: workflow + + - name: 'Consolidate plans' + id: consolidate_plans + run: | + mkdir -p '${{ inputs.plan_folder }}/defaults' + if [ -d workflow/${{ inputs.plan_folder }} ]; then + mv workflow/${{ inputs.plan_folder }}/* '${{ inputs.plan_folder }}/' + /bin/rm -r 'workflow/${{ inputs.plan_folder }}' + fi + if [ -f workflow/composer.json ]; then + mv workflow/composer.json '${{ inputs.plan_folder }}/' + fi + mv defaults/${{ inputs.default_plan_folder}}/* '${{ inputs.plan_folder }}/defaults/' + cat >'${{ inputs.plan_folder }}/_custom.yaml' <<'EOF' + # Generated from workflow input custom_testplan_yaml + ${{ inputs.custom_testplan_yaml }} + EOF + # The next line can be removed in v5 when the transition to yaml is finished + cp '${{ inputs.plan_folder }}/_custom.yaml' '${{ inputs.plan_folder }}/_custom.yml' + TESTPLAN=$(echo "${{ inputs.testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g') + echo "testplan=${{ inputs.plan_folder }}/defaults/defaults.yaml,${TESTPLAN}" >>"${GITHUB_OUTPUT}" + + - name: 'Load Testplan' + id: ltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{ steps.consolidate_plans.outputs.testplan }}' + set_output: true + set_env: true + set_print: true + # loglevel: trace + # logfile: load_testplan.log + yaml: generated_testplan.yaml + + - name: 'Prepare artifact and generate safe title' + id: post_ltp + if: always() + run: | + cp "${GITHUB_OUTPUT}" generated_output.txt + cp "${GITHUB_ENV}" generated_env.txt + echo 'title=${{steps.ltp.outputs.global_title}}'| \ + sed -E 's#\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \ + tee -a "${GITHUB_OUTPUT}" + + - name: Cache testplan + uses: tespkg/actions-cache/save@v1 + with: + path: | + ${{ inputs.plan_folder }}/* + key: '${{ steps.ltp.outputs.init_cache_name }}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + + - name: Install missing python3-yaml on private runners + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + shell: bash + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update + sudo apt-get -qq install python3-yaml + + - name: Obfuscate _custom yaml + if: always() + shell: python + run: | + import yaml + + def obfuscate(d): + for k, v in d.items(): + if isinstance(v, dict): + obfuscate(v) + else: + d[k]='***' + return d + + with open('${{ inputs.plan_folder }}/_custom.yaml','r') as f: + data = yaml.safe_load(f) + if isinstance(data, dict): + if 'secrets' in data: + data['secrets']=obfuscate(data['secrets']) + with open('${{ inputs.plan_folder }}/_custom.yaml', 'w') as file: + yaml.dump(data, file) + with open('${{ inputs.plan_folder }}/_custom.yml', 'w') as file: + yaml.dump(data, file) + + - name: 'Create first testplan archive' + if: always() + id: begin_report + uses: OXID-eSales/github-actions/begin_report@v4 + with: + title: ${{ steps.ltp.outputs.finish_slack_title }} + prefix: '${{ steps.post_ltp.outputs.title }}' + repository: '${{ github.server_url }}/${{ github.repository }}' + job: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + testplan: '${{ inputs.testplan }}' + files: | + ${{ inputs.plan_folder}}/* + generated_testplan.yaml + generated_output.txt + generated_env.txt + load_testplan.log + debug: ${{ inputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ steps.post_ltp.outputs.title }}' + header: true + phase: install + priority: '001' + cached_object: ${{ steps.ltp.outputs.init_cache_name }} + debug: false + + outputs: + debug: ${{ steps.begin_report.outputs.debug }} + global_title: ${{ steps.post_ltp.outputs.title }} + # init variables + testplan: ${{ steps.consolidate_plans.outputs.testplan }} + init_cache_bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + init_cache_name: ${{ steps.ltp.outputs.init_cache_name }} + # prepare_shop variables + prepare_shop_add_services: ${{ steps.ltp.outputs.prepare_shop_add_services }} + prepare_shop_cache_bucket: ${{ steps.ltp.outputs.prepare_shop_cache_bucket }} + prepare_shop_cache_prefix: ${{ steps.ltp.outputs.prepare_shop_cache_prefix }} + prepare_shop_composer_file: ${{ steps.ltp.outputs.prepare_shop_composer_file }} + prepare_shop_composer_transform: ${{ steps.ltp.outputs.prepare_shop_composer_transform }} + prepare_shop_composer_backup: ${{ steps.ltp.outputs.prepare_shop_composer_backup }} + prepare_shop_composer_update: ${{ steps.ltp.outputs.prepare_shop_composer_update }} + prepare_shop_composer_update_options: ${{ steps.ltp.outputs.prepare_shop_composer_update_options}} + prepare_shop_composer_dev_ref: ${{ steps.ltp.outputs.prepare_shop_composer_dev_ref }} + prepare_shop_container_method: ${{ steps.ltp.outputs.prepare_shop_container_method }} + prepare_shop_container_name: ${{ steps.ltp.outputs.prepare_shop_container_name }} + prepare_shop_container_options: ${{ steps.ltp.outputs.prepare_shop_container_options }} + prepare_shop_custom_ini_error_reporting: ${{ steps.ltp.outputs.prepare_shop_custom_ini_error_reporting }} + prepare_shop_custom_ini_xdebug: ${{ steps.ltp.outputs.prepare_shop_custom_ini_xdebug }} + prepare_shop_docker_login: ${{ steps.ltp.outputs.prepare_shop_docker_login }} + prepare_shop_git_enterprise_ref: ${{ steps.ltp.outputs.prepare_shop_git_enterprise_ref }} + prepare_shop_git_sdk_ref: ${{ steps.ltp.outputs.prepare_shop_git_sdk_ref }} + prepare_shop_git_sdk_url: ${{ steps.ltp.outputs.prepare_shop_git_sdk_url }} + prepare_shop_git_shop_ref: ${{ steps.ltp.outputs.prepare_shop_git_shop_ref }} + prepare_shop_git_shop_url: ${{ steps.ltp.outputs.prepare_shop_git_shop_url }} + prepare_shop_matrix_mysql: ${{ steps.ltp.outputs.prepare_shop_matrix_mysql }} + prepare_shop_matrix_php: ${{ steps.ltp.outputs.prepare_shop_matrix_php }} + prepare_shop_max_parallel: ${{ steps.ltp.outputs.prepare_shop_max_parallel }} + # install_shop variables + install_shop_cache_bucket: ${{ steps.ltp.outputs.install_shop_cache_bucket }} + install_shop_cache_prefix: ${{ steps.ltp.outputs.install_shop_cache_prefix }} + install_shop_config_idebug: ${{ steps.ltp.outputs.install_shop_config_idebug }} + install_shop_container_method: ${{ steps.ltp.outputs.install_shop_container_method }} + install_shop_container_name: ${{ steps.ltp.outputs.install_shop_container_name }} + install_shop_container_options: ${{ steps.ltp.outputs.install_shop_container_options }} + install_shop_docker_login: ${{ steps.ltp.outputs.install_shop_docker_login }} + install_shop_is_enterprise: ${{ steps.ltp.outputs.install_shop_is_enterprise }} + install_shop_matrix_mysql: ${{ steps.ltp.outputs.install_shop_matrix_mysql }} + install_shop_matrix_php: ${{ steps.ltp.outputs.install_shop_matrix_php }} + install_shop_max_parallel: ${{ steps.ltp.outputs.install_shop_max_parallel }} + install_shop_custom_script: ${{ steps.ltp.outputs.install_shop_custom_script }} + install_shop_custom_script_container: ${{ steps.ltp.outputs.install_shop_custom_script_container }} + install_shop_output_artifact_prefix: ${{ steps.ltp.outputs.install_shop_output_artifact_prefix }} + install_shop_output_files: ${{ steps.ltp.outputs.install_shop_output_files }} + # install_module variables + install_module_cache_prefix: ${{ steps.ltp.outputs.install_module_cache_prefix }} + install_module_matrix_mysql: ${{ steps.ltp.outputs.install_module_matrix_mysql }} + install_module_matrix_php: ${{ steps.ltp.outputs.install_module_matrix_php }} + install_module_matrix_testplan: ${{ steps.ltp.outputs.install_module_matrix_testplan }} + install_module_max_parallel: ${{ steps.ltp.outputs.install_module_max_parallel }} + # phpunit variables + phpunit_matrix_mysql: ${{ steps.ltp.outputs.phpunit_matrix_mysql }} + phpunit_matrix_php: ${{ steps.ltp.outputs.phpunit_matrix_php }} + phpunit_matrix_testplan: ${{ steps.ltp.outputs.phpunit_matrix_testplan }} + phpunit_max_parallel: ${{ steps.ltp.outputs.phpunit_max_parallel }} + # codeception_tests variables + codeception_matrix_mysql: ${{ steps.ltp.outputs.codeception_matrix_mysql }} + codeception_matrix_php: ${{ steps.ltp.outputs.codeception_matrix_php }} + codeception_matrix_testplan: ${{ steps.ltp.outputs.codeception_matrix_testplan }} + codeception_max_parallel: ${{ steps.ltp.outputs.codeception_max_parallel }} + # runtest variables + runtest_matrix_mysql: ${{ steps.ltp.outputs.runtest_matrix_mysql }} + runtest_matrix_php: ${{ steps.ltp.outputs.runtest_matrix_php }} + runtest_matrix_testplan: ${{ steps.ltp.outputs.runtest_matrix_testplan }} + runtest_max_parallel: ${{ steps.ltp.outputs.runtest_max_parallel }} + # sonarcloud variables + sonarcloud_matrix_mysql: ${{ steps.ltp.outputs.sonarcloud_matrix_mysql }} + sonarcloud_matrix_php: ${{ steps.ltp.outputs.sonarcloud_matrix_php }} + sonarcloud_matrix_testplan: ${{ steps.ltp.outputs.sonarcloud_matrix_testplan }} + sonarcloud_max_parallel: ${{ steps.ltp.outputs.sonarcloud_max_parallel }} + # phpcs_tests variables + phpcs_tests_additional_options: ${{ steps.ltp.outputs.phpcs_tests_additional_options }} + phpcs_tests_cache_bucket: ${{ steps.ltp.outputs.phpcs_tests_cache_bucket }} + phpcs_tests_container_method: ${{ steps.ltp.outputs.phpcs_tests_container_method }} + phpcs_tests_container_name: ${{ steps.ltp.outputs.phpcs_tests_container_name }} + phpcs_tests_container_options: ${{ steps.ltp.outputs.phpcs_tests_container_options }} + phpcs_tests_docker_login: ${{ steps.ltp.outputs.phpcs_tests_docker_login }} + phpcs_tests_diff_only: ${{ steps.ltp.outputs.phpcs_tests_diff_only }} + phpcs_tests_failure_pattern: ${{ steps.ltp.outputs.phpcs_tests_failure_pattern }} + phpcs_tests_filter: ${{ steps.ltp.outputs.phpcs_tests_filter }} + phpcs_tests_git_ref: ${{ steps.ltp.outputs.phpcs_tests_git_ref }} + phpcs_tests_logfile_prefix: ${{ steps.ltp.outputs.phpcs_tests_logfile_prefix }} + phpcs_tests_output_prefix: ${{ steps.ltp.outputs.phpcs_tests_output_prefix }} + phpcs_tests_output_files: ${{ steps.ltp.outputs.phpcs_tests_output_files }} + phpcs_tests_matrix_mysql: ${{ steps.ltp.outputs.phpcs_tests_matrix_mysql }} + phpcs_tests_matrix_php: ${{ steps.ltp.outputs.phpcs_tests_matrix_php }} + phpcs_tests_max_parallel: ${{ steps.ltp.outputs.phpcs_tests_max_parallel }} + phpcs_tests_skip: ${{ steps.ltp.outputs.phpcs_tests_skip }} + # phpmd variables + phpmd_matrix_mysql: ${{ steps.ltp.outputs.phpmd_matrix_mysql }} + phpmd_matrix_php: ${{ steps.ltp.outputs.phpmd_matrix_php }} + phpmd_matrix_testplan: ${{ steps.ltp.outputs.phpmd_matrix_testplan }} + phpmd_max_parallel: ${{ steps.ltp.outputs.phpmd_max_parallel }} + # phpstan variables + phpstan_matrix_mysql: ${{ steps.ltp.outputs.phpstan_matrix_mysql }} + phpstan_matrix_php: ${{ steps.ltp.outputs.phpstan_matrix_php }} + phpstan_matrix_testplan: ${{ steps.ltp.outputs.phpstan_matrix_testplan }} + phpstan_max_parallel: ${{ steps.ltp.outputs.phpstan_max_parallel }} + # styles variables + styles_matrix_mysql: ${{ steps.ltp.outputs.styles_matrix_mysql }} + styles_matrix_php: ${{ steps.ltp.outputs.styles_matrix_php }} + styles_matrix_testplan: ${{ steps.ltp.outputs.styles_matrix_testplan }} + styles_max_parallel: ${{ steps.ltp.outputs.styles_max_parallel }} + # yamllint variables + yamllint_skip: ${{ steps.ltp.outputs.yamllint_skip }} + yamllint_file_or_dir: ${{ steps.ltp.outputs.yamllint_file_or_dir }} + yamllint_rules: ${{ steps.ltp.outputs.yamllint_rules }} + # actionlint variables + actionlint_skip: ${{ steps.ltp.outputs.actionlint_skip }} + # finish variables + finish_matrix_mysql: ${{ steps.ltp.outputs.finish_matrix_mysql }} + finish_matrix_php: ${{ steps.ltp.outputs.finish_matrix_php }} + finish_skip: ${{ steps.ltp.outputs.finish_skip }} + finish_slack_title: ${{ steps.ltp.outputs.finish_slack_title }} + finish_slack_compact: ${{ steps.ltp.outputs.finish_slack_compact }} + + prepare_shop: + needs: init + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.prepare_shop_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.prepare_shop_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.prepare_shop_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + + steps: + - name: 'Prepare Shop' + id: prepare_shop + uses: 'OXID-eSales/github-actions/prepare_shop@v4' + with: + container_name: ${{ needs.init.outputs.prepare_shop_container_name }} + container_options: ${{ needs.init.outputs.prepare_shop_container_options }} + container_method: ${{ needs.init.outputs.prepare_shop_container_method }} + docker_login: ${{ needs.init.outputs.prepare_shop_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + git_sdk_url: ${{ needs.init.outputs.prepare_shop_git_sdk_url }} + git_sdk_ref: ${{ needs.init.outputs.prepare_shop_git_sdk_ref }} + git_shop_url: ${{ needs.init.outputs.prepare_shop_git_shop_url }} + git_shop_ref: ${{ needs.init.outputs.prepare_shop_git_shop_ref }} + git_enterprise_ref: ${{ needs.init.outputs.prepare_shop_git_enterprise_ref }} + github_event_name: ${{ github.event_name }} + github_event_number: ${{ github.event.number }} + github_base_ref: ${{ github.base_ref }} + github_ref_name: ${{ github.ref_name }} + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + custom_ini_error_reporting: ${{ needs.init.outputs.prepare_shop_custom_ini_error_reporting }} + custom_ini_xdebug: ${{ needs.init.outputs.prepare_shop_custom_ini_xdebug }} + add_services: ${{ needs.init.outputs.prepare_shop_add_services }} + composer_file: ${{ needs.init.outputs.prepare_shop_composer_file }} + composer_transform: ${{ needs.init.outputs.prepare_shop_composer_transform}} + composer_backup: ${{ needs.init.outputs.prepare_shop_composer_backup}} + composer_update: ${{ needs.init.outputs.prepare_shop_composer_update}} + composer_update_options: ${{ needs.init.outputs.prepare_shop_composer_update_options}} + composer_dev_ref: ${{ needs.init.outputs.prepare_shop_composer_dev_ref}} + enterprise_github_token: ${{ secrets.enterprise_github_token || github.token }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Cache current installation + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ needs.init.outputs.prepare_shop_cache_bucket }} + + - name: Debug cache current installation + if: ${{ inputs.debug }} + shell: bash + run: | + # prepare_shop: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + CACHE_NAME='${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '010' + phase: install + job: prepare_shop + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + cached_object: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + debug: ${{ inputs.debug }} + + install_shop: + needs: ['init', 'prepare_shop'] + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.install_shop_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.install_shop_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.install_shop_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + cache_bucket: ${{ needs.init.outputs.install_shop_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ needs.init.outputs.install_shop_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Install shop' + id: install_shop + uses: 'OXID-eSales/github-actions/install_shop@v4' + with: + container_name: ${{ needs.init.outputs.install_shop_container_name }} + container_options: ${{ needs.init.outputs.install_shop_container_options }} + container_method: ${{ needs.init.outputs.install_shop_container_method }} + is_enterprise: ${{ needs.init.outputs.install_shop_is_enterprise }} + config_idebug: ${{ needs.init.outputs.install_shop_config_idebug }} + debug: ${{ needs.init.outputs.debug }} + + - name: Write files list + if: always() + shell: bash + run: | + # install_shop: Write files list + find . >files.txt + # Compensate for multiline problems + { + echo 'ARTIFACT_PATHS<> "${GITHUB_ENV}" + + - name: Upload configuration artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: 'configs-install_shop-${{needs.init.outputs.global_title}}-PHP${{ matrix.php }}-MYSQL${{ matrix.mysql }}' + path: |- + ${{ env.ARTIFACT_PATHS }} + + - name: Run custom scripts + if: ${{ needs.init.outputs.install_shop_custom_script != '' || needs.init.outputs.install_shop_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ needs.init.outputs.install_shop_container_name }} + container_options: ${{ needs.init.outputs.install_shop_container_options }} + container_method: ${{ needs.init.outputs.install_shop_container_method }} + custom_script: ${{ needs.init.outputs.install_shop_custom_script }} + custom_script_container: ${{ needs.init.outputs.install_shop_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Debug cache current installation + if: ${{ inputs.debug }} + shell: bash + run: | + # prepare_shop: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + CACHE_NAME='${{ needs.init.outputs.install_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: Cache current installation + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ needs.init.outputs.install_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ needs.init.outputs.install_shop_cache_bucket }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '020' + phase: install + job: install_shop + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + cached_object: '${{ needs.init.outputs.install_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + debug: ${{ inputs.debug }} + + install_module: + needs: ['init', 'install_shop'] + strategy: + matrix: + testplan: ${{ fromJSON(needs.init.outputs.install_module_matrix_testplan) }} + php: ${{ fromJSON(needs.init.outputs.install_module_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.install_module_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.install_module_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + if: ${{ matrix.testplan != 'skip' }} + id: install_module_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: ${{needs.init.outputs.global_title}} + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: install_module_testplan + if: ${{ matrix.testplan != 'skip' }} + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.install_module_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + if: ${{ matrix.testplan != 'skip' }} + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + # yamllint disable-line rule:line-length + cached_shop: '${{ steps.install_module_testplan.outputs.install_module_load_shop}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + cache_bucket: ${{ steps.install_module_testplan.outputs.install_module_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.install_module_testplan.outputs.install_module_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: Checkout module + id: checkout_module + if: ${{ matrix.testplan != 'skip' }} + run: | + AUTH="oxidci:${{ secrets.enterprise_github_token || github.token }}" + + if [[ '${{ github.event_name }}' == 'pull_request' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ce' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ee' ]]; then + echo -e "\033[0;35mHandling the pull request\033[0m" + git clone --depth 2 \ + https://${AUTH}@github.com/${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch ${{ github.base_ref }} \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' fetch origin \ + refs/pull/${{ github.event.number }}/head:pr_${{ github.event.number }} + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' checkout pr_${{ github.event.number }} + echo "module_ref=pr_${{ github.event.number }}" >>"${GITHUB_OUTPUT}" + else + MODULE_REF="$(echo "${{ steps.install_module_testplan.outputs.install_module_git_module_ref }}"|sed -e 's|^dev-||')" + git clone --depth 2 \ + https://${AUTH}@github.com/${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch "${MODULE_REF}" \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + echo "module_ref=${MODULE_REF}" >>"${GITHUB_OUTPUT}" + fi + find . -type f >files.txt + if [ '${{ inputs.debug }}' == 'true' ]; then + cat >>debug/debug.sh <<'EODS' + banner "Checkout module" + # Note: we use ssh here, the workflow uses https and the runtime token or enterprise token + if [[ '${{ github.event_name }}' == 'pull_request' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ce' && \ + '${{github.repository}}' != 'OXID-eSales/oxideshop_ee' ]]; then + echo -e "\033[0;35mHandling the pull request\033[0m" + git clone --depth 2 \ + git@github.com:${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch ${{ github.base_ref }} \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' fetch origin \ + refs/pull/${{ github.event.number }}/head:pr_${{ github.event.number }} + git -C 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' checkout pr_${{ github.event.number }} + else + MODULE_REF="$(echo "${{ steps.install_module_testplan.outputs.install_module_git_module_ref }}"|sed -e 's|^dev-||')" + git clone --depth 2 \ + git@github.com:${{ steps.install_module_testplan.outputs.install_module_git_module_url }}.git \ + --branch "${MODULE_REF}" \ + --single-branch 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + fi + find . -type f >files.txt + EODS + fi + + - name: 'Modify composer.json' + if: ${{ steps.install_module_testplan.outputs.install_module_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}/composer.json' + backup: true + transform: | + ${{ steps.install_module_testplan.outputs.install_module_composer_transform }} + update: ${{ steps.install_module_testplan.outputs.install_module_composer_update }} + update_options: ${{ steps.install_module_testplan.outputs.install_module_composer_update_options }} + container_name: ${{ steps.install_module_testplan.outputs.install_module_container_name }} + container_options: ${{ steps.install_module_testplan.outputs.install_module_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Install module + if: ${{ matrix.testplan != 'skip' }} + id: install_module + uses: 'OXID-eSales/github-actions/install_module@v4' + with: + container_name: ${{ steps.install_module_testplan.outputs.install_module_container_name }} + container_options: ${{ steps.install_module_testplan.outputs.install_module_container_options }} + container_method: ${{ steps.install_module_testplan.outputs.install_module_container_method }} + package_name: ${{ steps.install_module_testplan.outputs.install_module_package_name }} + module_ids: ${{ steps.install_module_testplan.outputs.install_module_ids }} + module_path: 'dev-packages/${{ steps.install_module_testplan.outputs.install_module_path }}' + activate: ${{ steps.install_module_testplan.outputs.install_module_activate }} + git_module_url: ${{ steps.install_module_testplan.outputs.install_module_git_module_url }} + git_module_ref: ${{ steps.checkout_module.outputs.module_ref }} + output_files: ${{ steps.install_module_testplan.outputs.install_module_output_files }} + # yamllint disable-line rule:line-length + output_artifact: '${{steps.install_module_testplan.outputs.install_module_output_artifact_prefix}}-${{steps.install_module_testplan.outputs.install_module_ids}}-${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + enterprise_github_token: ${{ secrets.enterprise_github_token || github.token}} + debug: ${{ needs.init.outputs.debug }} + + - name: Run custom scripts + # yamllint disable-line rule:line-length + if: ${{ matrix.testplan != 'skip' && (steps.install_module_testplan.outputs.install_module_custom_script != '' || steps.install_module_testplan.outputs.install_module_custom_script_container != '') }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.install_module_testplan.outputs.install_module_container_name }} + container_options: ${{ steps.install_module_testplan.outputs.install_module_container_options }} + container_method: ${{ steps.install_module_testplan.outputs.install_module_container_method }} + custom_script: ${{ steps.install_module_testplan.outputs.install_module_custom_script }} + custom_script_container: ${{ steps.install_module_testplan.outputs.install_module_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() && matrix.testplan != 'skip' }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Cache current installation + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ steps.install_module_testplan.outputs.install_module_cache_prefix}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.install_module_testplan.outputs.install_module_cache_bucket }} + + - name: Debug cache current installation + if: ${{ matrix.testplan != 'skip' && inputs.debug }} + shell: bash + run: | + # prepare_shop: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + CACHE_NAME='${{ steps.install_module_testplan.outputs.install_module_cache_prefix}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: 'Write Report' + if: ${{ always() && matrix.testplan != 'skip' }} + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '030' + phase: install + job: install_module + title: ${{ steps.install_module_testplan.outputs.install_module_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + cached_object: '${{ steps.install_module_testplan.outputs.install_module_cache_prefix}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' + debug: ${{ inputs.debug }} + + - name: 'Write Report' + if: ${{ always() && matrix.testplan == 'skip' }} + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '030' + phase: install + job: install_module + title: 'none' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: 'skipped' + debug: ${{ inputs.debug }} + + begin_test_phase: + needs: ['init', 'install_module'] + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + header: true + priority: '100' + phase: test + debug: false + + phpunit: + needs: ['init', 'install_module', 'begin_test_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.phpunit_matrix_testplan != '' && needs.init.outputs.phpunit_matrix_testplan != 'skip' && needs.init.outputs.phpunit_matrix_testplan != 'none' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpunit_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpunit_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.phpunit_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpunit_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: phpunit_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: phpunit_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.phpunit_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.phpunit_testplan.outputs.phpunit_load_shop}}_${{ steps.phpunit_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.phpunit_testplan.outputs.phpunit_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.phpunit_testplan.outputs.phpunit_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: Run custom scripts + if: ${{ steps.phpunit_testplan.outputs.phpunit_custom_script != '' || steps.phpunit_testplan.outputs.phpunit_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.phpunit_testplan.outputs.phpunit_container_name }} + container_options: ${{ steps.phpunit_testplan.outputs.phpunit_container_options }} + container_method: ${{ steps.phpunit_testplan.outputs.phpunit_container_method }} + custom_script: ${{ steps.phpunit_testplan.outputs.phpunit_custom_script }} + custom_script_container: ${{ steps.phpunit_testplan.outputs.phpunit_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpunit tests' + id: phpunit_run + uses: 'OXID-eSales/github-actions/phpunit@v4' + with: + container_name: ${{ steps.phpunit_testplan.outputs.phpunit_container_name }} + container_options: ${{ steps.phpunit_testplan.outputs.phpunit_container_options }} + container_method: ${{ steps.phpunit_testplan.outputs.phpunit_container_method }} + configuration: ${{ steps.phpunit_testplan.outputs.phpunit_configuration }} + test: ${{ steps.phpunit_testplan.outputs.phpunit_test }} + additional_options: ${{ steps.phpunit_testplan.outputs.phpunit_additional_options }} + # yamllint disable-line rule:line-length + logfile: ${{steps.phpunit_testplan.outputs.phpunit_logfile_prefix}}-${{ steps.phpunit_testplan.outputs.phpunit_title }}-${{steps.phpunit_testplan_name.outputs.matrix_suffix}}.txt + output_files: ${{ steps.phpunit_testplan.outputs.phpunit_output_files }} + output_artifact: ${{steps.phpunit_testplan.outputs.phpunit_output_prefix}}-${{steps.phpunit_testplan_name.outputs.matrix_suffix}} + coverage_path: ${{ steps.phpunit_testplan.outputs.phpunit_coverage_path }} + coverage_artifact: ${{ steps.phpunit_testplan.outputs.phpunit_coverage_prefix }}-${{steps.phpunit_testplan_name.outputs.matrix_suffix}} + failure_pattern: ${{ steps.phpunit_testplan.outputs.phpunit_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '110' + phase: test + job: phpunit + title: ${{ steps.phpunit_testplan.outputs.phpunit_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + codeception: + needs: ['init', 'install_module', 'begin_test_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.codeception_matrix_testplan != '' && needs.init.outputs.codeception_matrix_testplan != 'none' && needs.init.outputs.codeception_matrix_testplan != 'skip' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.codeception_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.codeception_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.codeception_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.codeception_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: codeception_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: codeception_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.codeception_testplan_name.outputs.testplan}}' + set_output: true + set_env: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: Run pre-script + id: pre_script + shell: bash + run: | + # codeception: Run pre-script + ${{ needs.init.outputs.debug }} + ${{ steps.codeception_testplan.outputs.codeception_pre_script }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.codeception_testplan.outputs.codeception_load_shop}}_${{ steps.codeception_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.codeception_testplan.outputs.codeception_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.codeception_testplan.outputs.codeception_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + wait_for_selenium: ${{ steps.codeception_testplan.outputs.codeception_wait_for_selenium }} + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.codeception_testplan.outputs.codeception_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.codeception_testplan.outputs.codeception_composer_file }}' + backup: true + transform: | + ${{ steps.codeception_testplan.outputs.codeception_composer_transform }} + update: ${{ steps.codeception_testplan.outputs.codeception_composer_update }} + update_options: ${{ steps.codeception_testplan.outputs.codeception_composer_update_options }} + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + container_options: ${{ steps.codeception_testplan.outputs.codeception_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + # yamllint disable-line rule:line-length + if: ${{ steps.codeception_testplan.outputs.codeception_custom_script != '' || steps.codeception_testplan.outputs.codeception_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + container_options: ${{ steps.codeception_testplan.outputs.codeception_container_options }} + container_method: ${{ steps.codeception_testplan.outputs.codeception_container_method }} + custom_script: ${{ steps.codeception_testplan.outputs.codeception_custom_script }} + custom_script_container: ${{ steps.codeception_testplan.outputs.codeception_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run codeception tests' + id: codeception_run + uses: 'OXID-eSales/github-actions/codeception@v4' + with: + container_name: ${{ steps.codeception_testplan.outputs.codeception_container_name }} + container_options: '${{ steps.codeception_testplan.outputs.codeception_container_options }} ${{ steps.pre_script.outputs.container_options }}' + container_method: ${{ steps.codeception_testplan.outputs.codeception_container_method }} + build: ${{ steps.codeception_testplan.outputs.codeception_build }} + configuration: ${{ steps.codeception_testplan.outputs.codeception_configuration }} + suite: ${{ steps.codeception_testplan.outputs.codeception_suite }} + test: ${{ steps.codeception_testplan.outputs.codeception_test }} + additional_options: ${{ steps.codeception_testplan.outputs.codeception_additional_options }} + build_additional_options: ${{ steps.codeception_testplan.outputs.codeception_build_additional_options }} + # yamllint disable-line rule:line-length + logfile: ${{steps.codeception_testplan.outputs.codeception_logfile_prefix}}-${{steps.codeception_testplan.outputs.codeception_title}}-${{steps.codeception_testplan_name.outputs.matrix_suffix}}.txt + output_files: ${{ steps.codeception_testplan.outputs.codeception_output_files }} + output_artifact: ${{steps.codeception_testplan.outputs.codeception_output_prefix}}-${{steps.codeception_testplan_name.outputs.matrix_suffix}} + coverage_path: ${{ steps.codeception_testplan.outputs.codeception_coverage_path }} + coverage_artifact: ${{ steps.codeception_testplan.outputs.codeception_coverage_prefix }}-${{steps.codeception_testplan_name.outputs.matrix_suffix}} + failure_pattern: ${{ steps.codeception_testplan.outputs.codeception_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '120' + phase: test + job: codeception + title: ${{ steps.codeception_testplan.outputs.codeception_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + runtest: + needs: ['init', 'install_module', 'begin_test_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.runtest_matrix_testplan != '' && needs.init.outputs.runtest_matrix_testplan != 'none' && needs.init.outputs.runtest_matrix_testplan != 'skip' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.runtest_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.runtest_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.runtest_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.runtest_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: runtest_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: runtest_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.runtest_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: Set swap space + if: ${{ inputs.runs_on == '"ubuntu-latest"' }} + uses: actionhippie/swap-space@v1 + with: + size: 10G + path: swapfile + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.runtest_testplan.outputs.runtest_load_shop}}_${{ steps.runtest_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.runtest_testplan.outputs.runtest_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.runtest_testplan.outputs.runtest_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.runtest_testplan.outputs.runtest_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.runtest_testplan.outputs.runtest_composer_file }}' + backup: true + transform: | + ${{ steps.runtest_testplan.outputs.runtest_composer_transform }} + update: ${{ steps.runtest_testplan.outputs.runtest_composer_update }} + update_options: ${{ steps.runtest_testplan.outputs.runtest_composer_update_options }} + container_name: ${{ steps.runtest_testplan.outputs.runtest_container_name }} + container_options: ${{ steps.runtest_testplan.outputs.runtest_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Copy config file + run: | + cp source/vendor/oxid-esales/testing-library/test_config.yml.dist source/test_config.yml + ${{ needs.init.outputs.debug }} + + + - name: Run custom scripts + if: ${{ steps.runtest_testplan.outputs.runtest_custom_script != '' || steps.runtest_testplan.outputs.runtest_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.runtest_testplan.outputs.runtest_container_name }} + container_options: ${{ steps.runtest_testplan.outputs.runtest_container_options }} + container_method: ${{ steps.runtest_testplan.outputs.runtest_container_method }} + custom_script: ${{ steps.runtest_testplan.outputs.runtest_custom_script }} + custom_script_container: ${{ steps.runtest_testplan.outputs.runtest_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run tests' + id: runtest_run + uses: 'OXID-eSales/github-actions/runtests@v4' + with: + container_name: ${{ steps.runtest_testplan.outputs.runtest_container_name }} + container_options: ${{ steps.runtest_testplan.outputs.runtest_container_options }} + container_method: ${{ steps.runtest_testplan.outputs.runtest_container_method }} + test: ${{ steps.runtest_testplan.outputs.runtest_test }} + additional_options: ${{ steps.runtest_testplan.outputs.runtest_additional_options }} + # yamllint disable-line rule:line-length + logfile: ${{ steps.runtest_testplan.outputs.runtest_logfile_prefix}}-${{ steps.runtest_testplan.outputs.runtest_title}}-${{ steps.runtest_testplan_name.outputs.matrix_suffix }}.txt + output_files: ${{ steps.runtest_testplan.outputs.runtest_output_files }} + output_artifact: ${{ steps.runtest_testplan.outputs.runtest_output_prefix }}-${{ steps.runtest_testplan_name.outputs.matrix_suffix }} + coverage_path: ${{ steps.runtest_testplan.outputs.runtest_coverage_path }} + coverage_artifact: ${{ steps.runtest_testplan.outputs.runtest_coverage_prefix }}-${{ steps.runtest_testplan_name.outputs.matrix_suffix }} + failure_pattern: ${{ steps.runtest_testplan.outputs.runtest_failure_pattern }} + reset_shop: ${{ steps.runtest_testplan.outputs.runtest_reset_shop }} + reset_shop_binary: ${{ steps.runtest_testplan.outputs.runtest_reset_shop_binary }} + runtests_binary: ${{ steps.runtest_testplan.outputs.runtest_runtests_binary }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '130' + phase: test + job: runtest + title: ${{ steps.runtest_testplan.outputs.runtest_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + begin_report_phase: + needs: ['init', 'install_module'] + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + header: true + priority: '200' + phase: report + debug: false + + phpmd: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ needs.init.outputs.phpmd_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpmd_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpmd_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.phpmd_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpmd_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: phpmd_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: phpmd_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.phpmd_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.phpmd_testplan.outputs.phpmd_load_shop}}_${{ steps.phpmd_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.phpmd_testplan.outputs.phpmd_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.phpmd_testplan.outputs.phpmd_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.phpmd_testplan.outputs.phpmd_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.phpmd_testplan.outputs.phpmd_composer_file }}' + backup: true + transform: | + ${{ steps.phpmd_testplan.outputs.phpmd_composer_transform }} + update: ${{ steps.phpmd_testplan.outputs.phpmd_composer_update }} + update_options: ${{ steps.phpmd_testplan.outputs.phpmd_composer_update_options }} + container_name: ${{ steps.phpmd_testplan.outputs.phpmd_container_name }} + container_options: ${{ steps.phpmd_testplan.outputs.phpmd_container_options }} + container_method: ${{ steps.phpmd_testplan.outputs.phpmd_container_method }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + if: ${{ steps.phpmd_testplan.outputs.phpmd_custom_script != '' || steps.phpmd_testplan.outputs.phpmd_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.phpmd_testplan.outputs.phpmd_container_name }} + container_options: ${{ steps.phpmd_testplan.outputs.phpmd_container_options }} + container_method: ${{ steps.phpmd_testplan.outputs.phpmd_container_method }} + custom_script: ${{ steps.phpmd_testplan.outputs.phpmd_custom_script }} + custom_script_container: ${{ steps.phpmd_testplan.outputs.phpmd_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpmd check' + uses: 'OXID-eSales/github-actions/phpmd@v4' + with: + source_path: ${{ steps.phpmd_testplan.outputs.phpmd_source_path }} + report_path: ${{ steps.phpmd_testplan.outputs.phpmd_report_path }} + config: ${{ steps.phpmd_testplan.outputs.phpmd_config }} + baseline_file: ${{ steps.phpmd_testplan.outputs.phpmd_baseline_file }} + additional_options: ${{ steps.phpmd_testplan.outputs.phpmd_additional_options }} + title: ${{ steps.phpmd_testplan.outputs.phpmd_title }} + verbose: ${{ steps.phpmd_testplan.outputs.phpmd_verbose }} + generate_baseline: ${{ steps.phpmd_testplan.outputs.phpmd_generate_baseline }} + container_name: ${{ steps.phpmd_testplan.outputs.phpmd_container_name }} + container_options: ${{ steps.phpmd_testplan.outputs.phpmd_container_options }} + container_method: ${{ steps.phpmd_testplan.outputs.phpmd_container_method }} + output_artifact: ${{ steps.phpmd_testplan.outputs.phpmd_output_prefix}}_${{ steps.phpmd_testplan_name.outputs.matrix_suffix }} + failure_pattern: ${{ steps.phpmd_testplan.outputs.phpmd_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '210' + phase: report + job: phpmd + title: '${{ steps.phpmd_testplan.outputs.phpmd_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + phpstan: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ needs.init.outputs.phpstan_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpstan_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpstan_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.phpstan_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpstan_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: phpstan_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: phpstan_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.phpstan_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.phpstan_testplan.outputs.phpstan_load_shop}}_${{ steps.phpstan_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.phpstan_testplan.outputs.phpstan_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.phpstan_testplan.outputs.phpstan_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.phpstan_testplan.outputs.phpstan_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ steps.phpstan_testplan.outputs.phpstan_composer_file }}' + backup: true + transform: | + ${{ steps.phpstan_testplan.outputs.phpstan_composer_transform }} + update: ${{ steps.phpstan_testplan.outputs.phpstan_composer_update }} + update_options: ${{ steps.phpstan_testplan.outputs.phpstan_composer_update_options }} + container_name: ${{ steps.phpstan_testplan.outputs.phpstan_container_name }} + container_options: ${{ steps.phpstan_testplan.outputs.phpstan_container_options }} + container_method: ${{ steps.phpstan_testplan.outputs.phpstan_container_method }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + if: ${{ steps.phpstan_testplan.outputs.phpstan_custom_script != '' || steps.phpstan_testplan.outputs.phpstan_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.phpstan_testplan.outputs.phpstan_container_name }} + container_options: ${{ steps.phpstan_testplan.outputs.phpstan_container_options }} + container_method: ${{ steps.phpstan_testplan.outputs.phpstan_container_method }} + custom_script: ${{ steps.phpstan_testplan.outputs.phpstan_custom_script }} + custom_script_container: ${{ steps.phpstan_testplan.outputs.phpstan_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpstan check' + uses: 'OXID-eSales/github-actions/phpstan@v4' + with: + source_path: ${{ steps.phpstan_testplan.outputs.phpstan_source_path }} + report_path: ${{ steps.phpstan_testplan.outputs.phpstan_report_path }} + neon_file: ${{ steps.phpstan_testplan.outputs.phpstan_neon_file }} + additional_options: ${{ steps.phpstan_testplan.outputs.phpstan_additional_options }} + title: ${{ steps.phpstan_testplan.outputs.phpstan_title }} + verbose: ${{ steps.phpstan_testplan.outputs.phpstan_verbose }} + generate_baseline: ${{ steps.phpstan_testplan.outputs.phpstan_generate_baseline }} + container_name: ${{ steps.phpstan_testplan.outputs.phpstan_container_name }} + container_options: ${{ steps.phpstan_testplan.outputs.phpstan_container_options }} + container_method: ${{ steps.phpstan_testplan.outputs.phpstan_container_method }} + output_artifact: ${{ steps.phpstan_testplan.outputs.phpstan_output_prefix}}_${{ steps.phpstan_testplan_name.outputs.matrix_suffix }} + failure_pattern: ${{ steps.phpstan_testplan.outputs.phpstan_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '220' + phase: report + job: phpstan + title: '${{ steps.phpstan_testplan.outputs.phpstan_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + phpcs_tests: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ always() && needs.init.outputs.phpcs_tests_skip != 'true' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.phpcs_tests_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.phpcs_tests_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.phpcs_tests_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ needs.init.outputs.install_module_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + cache_bucket: ${{ needs.init.outputs.phpcs_tests_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ needs.init.outputs.phpcs_tests_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run phpcs tests' + uses: 'OXID-eSales/github-actions/phpcs@v4' + with: + container_name: ${{ needs.init.outputs.phpcs_tests_container_name }} + container_options: ${{ needs.init.outputs.phpcs_tests_container_options }} + container_method: ${{ needs.init.outputs.phpcs_tests_container_method }} + git_ref: ${{ needs.init.outputs.phpcs_tests_git_ref }} + diff_only: ${{ needs.init.outputs.phpcs_tests_diff_only}} + filter: ${{ needs.init.outputs.phpcs_tests_filter}} + additional_options: ${{ needs.init.outputs.phpcs_tests_additional_options }} + logfile: phpcs-PHP${{ matrix.php }}_MYSQL${{ matrix.mysql }}_codesniff_log.txt + output_artifact: ${{ needs.init.outputs.phpcs_tests_output_prefix }}-${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}} + output_files: ${{ needs.init.outputs.phpcs_tests_output_files }} + failure_pattern: ${{ needs.init.outputs.phpcs_tests_failure_pattern }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '230' + phase: report + job: phpcs + title: 'default' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + sonarcloud: + needs: ['init', 'install_module', 'phpunit', 'codeception', 'begin_report_phase'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.sonarcloud_matrix_testplan != '' && needs.init.outputs.sonarcloud_matrix_testplan != 'none' && needs.init.outputs.sonarcloud_matrix_testplan != 'skip' && needs.install_module.result == 'success' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.sonarcloud_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + steps: + - name: Warn if sonarcloud secret is missing + if: ${{ env.SONAR_TOKEN == '' }} + run: | + echo "::warning title=Missing secrets::Please set the repository secrets SONAR_TOKEN to run sonarcloud scans" + + - name: Load cached testplan + id: sonarcloud_testplan_name + if: ${{ env.SONAR_TOKEN != '' }} + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: sonarcloud_testplan + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.sonarcloud_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: Checkout shop + if: ${{ env.SONAR_TOKEN != '' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_repository }}' + ref: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_ref }}' + token: ${{ secrets.enterprise_github_token || github.token }} + + - name: 'SonarCloud Scan' + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'OXID-eSales/github-actions/sonarcloud@v4' + with: + coverage_artifact: 'coverage-reports-*-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' + output_artifact: 'coverage-reports-${{ needs.init.outputs.global_title }}' + target_branch: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_target_branch }} + strip_path: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_strip_path }} + github_ref_name: ${{ github.ref_name }} + sonarcloud_organization: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_organization }} + sonarcloud_project_key: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_key }} + sonarcloud_project_name: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_name }} + sonarcloud_parameters: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_parameters }} + sonar_token: ${{ secrets.SONAR_TOKEN }} + github_token: ${{ github.token }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + job: sonarcloud + title: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + styles: + needs: ['init', 'install_module', 'begin_report_phase'] + if: ${{ needs.init.outputs.styles_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.styles_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.styles_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.styles_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.styles_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + steps: + - name: Load cached testplan + id: styles_testplan_name + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: styles_testplan + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.styles_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + token: ${{ secrets.enterprise_github_token }} + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.styles_testplan.outputs.styles_load_shop}}_${{ steps.styles_testplan_name.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.styles_testplan.outputs.styles_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.styles_testplan.outputs.styles_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + debug: ${{ needs.init.outputs.debug }} + + - name: Update the github token + run: | + # Update github token + ${{ inputs.debug }} + docker compose exec -T \ + ${{ steps.styles_testplan.outputs.styles_container_options }} \ + ${{ steps.styles_testplan.outputs.styles_container_name }} \ + composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}" + + - name: 'Modify composer.json' + if: ${{ steps.styles_testplan.outputs.styles_composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/dev-packages/${{ steps.styles_testplan.outputs.styles_path }}/composer.json' + backup: true + transform: | + ${{ steps.styles_testplan.outputs.styles_composer_transform }} + update: ${{ steps.styles_testplan.outputs.styles_composer_update }} + update_options: ${{ steps.styles_testplan.outputs.styles_composer_update_options }} + container_name: ${{ steps.styles_testplan.outputs.styles_container_name }} + container_options: ${{ steps.styles_testplan.outputs.styles_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run custom scripts + if: ${{ steps.styles_testplan.outputs.styles_custom_script != '' || steps.styles_testplan.outputs.styles_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.styles_testplan.outputs.styles_container_name }} + container_options: ${{ steps.styles_testplan.outputs.styles_container_options }} + container_method: ${{ steps.styles_testplan.outputs.styles_container_method }} + custom_script: ${{ steps.styles_testplan.outputs.styles_custom_script }} + custom_script_container: ${{ steps.styles_testplan.outputs.styles_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run styles check' + uses: 'OXID-eSales/github-actions/styles@v4' + with: + path: ${{ steps.styles_testplan.outputs.styles_path }} + module_ids: ${{ steps.styles_testplan.outputs.styles_module_ids }} + install_options: ${{ steps.styles_testplan.outputs.styles_install_options }} + container_name: ${{ steps.styles_testplan.outputs.styles_container_name }} + container_options: ${{ steps.styles_testplan.outputs.styles_container_options }} + container_method: ${{ steps.styles_testplan.outputs.styles_container_method }} + output_files: ${{ steps.styles_testplan.outputs.styles_output_files }} + output_artifact: ${{ steps.styles_testplan.outputs.styles_output_prefix}}_${{ steps.styles_testplan_name.outputs.matrix_suffix }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '250' + phase: report + job: styles + title: '${{ steps.styles_testplan.outputs.styles_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + + yamllint: + needs: ['init', 'begin_report_phase'] + if: ${{ always() && needs.init.outputs.yamllint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Lint yaml files + id: yamllint + uses: OXID-eSales/github-actions/yamllint@v4 + with: + file_or_dir: ${{ needs.init.outputs.yamllint_file_or_dir }} + config_data: ${{ needs.init.outputs.yamllint_rules }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write yamllint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + title: '' + job: 'yamllint' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + + actionlint: + needs: ['init', 'begin_report_phase'] + if: ${{ always() && needs.init.outputs.actionlint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Install npm on private runner + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + run: | + NPM=$(type -p 'npm'||true) + 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 python3-venv + fi + + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Run actionlint + id: actionlint + uses: raven-actions/actionlint@v2 + + - name: actionlint Summary + if: always() + run: | + echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}" + echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}" + echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code" + echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'" + echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors" + echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files" + echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}" + + - name: 'Write actionlint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '250' + phase: report + job: 'actionlint' + title: '' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + + finish: + if: ${{ always() && needs.init.outputs.finish_skip != 'true' }} + needs: + - init + - prepare_shop + - install_shop + - install_module + - phpunit + - codeception + - runtest + - sonarcloud + - phpcs_tests + - phpmd + - phpstan + - styles + - yamllint + - actionlint + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + SLACK_WEBHOOK: "${{ secrets.SLACK_WEBHOOK_URL }}" + steps: + - name: 'Generate report' + id: generate_report + uses: 'OXID-eSales/github-actions/generate_report@v4' + with: + prefix: '${{ needs.init.outputs.global_title }}' + slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + title: '${{ needs.init.outputs.finish_slack_title }}' + compact: '${{ needs.init.outputs.finish_slack_compact }}' + debug: ${{ inputs.debug }} + + - name: 'Checkout the repo for cleanup' + uses: actions/checkout@v4 + with: + path: repo + + - name: 'Clean Cache' + # if: ${{ steps.generate_report.outputs.overall_status == 'success' }} + uses: 'OXID-eSales/github-actions/clean_cache@v4' + env: + GH_TOKEN: ${{ github.token }} + with: + path: repo + runs_on: ${{ inputs.runs_on }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_objects: | + ${{ steps.generate_report.outputs.cache_objects }} + debug: ${{ needs.init.outputs.debug }} diff --git a/.github/workflows/dispatch-release.yaml.backup b/.github/workflows/dispatch-release.yaml.backup new file mode 100644 index 00000000..fc0d25c4 --- /dev/null +++ b/.github/workflows/dispatch-release.yaml.backup @@ -0,0 +1,112 @@ +name: dispatch_release +# Create a new release of the github-actions module + +# yamllint disable-line rule:truthy +on: + workflow_dispatch: + inputs: + feature_branch: + type: string + required: false + description: 'Name of the feature branch, if empty, use the current branch' + default: '' + major: + type: string + required: true + description: 'Major version number (X.?.?)' + minor: + type: string + required: true + description: 'Minor version number (?.X.?)' + patch: + type: string + required: true + description: 'Patch version number (?.?.X)' + reviewer: + type: choice + required: true + description: 'who should review the PR' + options: + - joernott + - snehasreeramini + +jobs: + prepare_release: + runs-on: 'ubuntu-latest' + steps: + - name: 'Get branch' + id: branch + run: | + # Get branch + BRANCH='${{ inputs.feature_branch }}' + if [ -z "${BRANCH}" ]; then + BRANCH="${GITHUB_REF}" + fi + echo "branch=${BRANCH}" >>"${GITHUB_OUTPUT}" + + - name: 'Checkout repo' + uses: actions/checkout@v4 + with: + repository: 'OXID-eSales/github-actions' + ref: '${{ steps.branch.outputs.branch }}' + path: 'github-actions' + fetch-depth: 0 + + - name: Validate version + run: | + # Validate version + cd github-actions + CHECK=$(git tag --list|grep "v${{inputs.major}}.${{inputs.minor}}.${{inputs.patch}}"||true) + if [ -n "${CHECK}" ]; then + cat <'${{ inputs.plan_folder }}/_custom.yaml' <<'EOF' + # Generated from workflow input custom_testplan_yaml + ${{ inputs.custom_testplan_yaml }} + EOF + # ToDo: The next line can be removed in v5 when the transition to yaml is finished + cp '${{ inputs.plan_folder }}/_custom.yaml' '${{ inputs.plan_folder }}/_custom.yml' + if [ '${{ github.event_name }}' == 'pull_request' ]; then + REF=$(echo '{{ .Github.HeadRef }}'|sed -e 's|/refs/heads/||') + # This is the git ref name + sed -e "s|safe_ref_name:.*|safe_ref_name: ${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml' + # This is the same for composer but with an added dev- prefix + sed -e "s|ref_name: dev-.*|ref_name: dev-${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml' + fi + + TESTPLAN=$(echo "${{ inputs.testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g') + # ToDo: Remove the ,${{ inputs.plan_folder }}/defaults/_rename.yaml when releasing v5 + DEFAULTS="${{ inputs.plan_folder }}/defaults/defaults_light.yaml" + echo "testplan=${DEFAULTS},${TESTPLAN},${{ inputs.plan_folder }}/defaults/_rename.yaml" >>"${GITHUB_OUTPUT}" + + - name: 'Load Testplan' + id: ltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{ steps.consolidate_plans.outputs.testplan }}' + set_output: true + set_env: true + set_print: true + loglevel: info + logfile: load_testplan_init.log + yaml: generated_testplan.yaml + + - name: 'Prepare artifact and generate safe title' + id: post_ltp + if: always() + run: | + cp "${GITHUB_OUTPUT}" generated_output.txt + cp "${GITHUB_ENV}" generated_env.txt + echo 'title=${{steps.ltp.outputs.global_title}}'| \ + sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \ + tee -a "${GITHUB_OUTPUT}" + + - name: Cache testplan on S3 + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + uses: tespkg/actions-cache/save@v1 + with: + path: | + ${{ inputs.plan_folder }}/* + key: '${{ steps.ltp.outputs.init_cache_name }}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + + - name: Cache testplan on Github + if: ${{ inputs.runs_on == '"ubuntu-latest"'}} + uses: actions/cache/save@v4 + with: + path: | + ${{ inputs.plan_folder }}/* + key: '${{ steps.ltp.outputs.init_cache_name }}' + + - name: Install missing python3-yaml on private runners + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + shell: bash + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update + sudo apt-get -qq install python3-yaml + + - name: Obfuscate _custom yaml + if: always() + shell: python + run: | + import yaml + + def obfuscate(d): + for k, v in d.items(): + if isinstance(v, dict): + obfuscate(v) + else: + d[k]='***' + return d + + with open('${{ inputs.plan_folder }}/_custom.yaml','r') as f: + data = yaml.safe_load(f) + if isinstance(data, dict): + if 'secrets' in data: + data['secrets']=obfuscate(data['secrets']) + with open('${{ inputs.plan_folder }}/_custom.yaml', 'w') as file: + yaml.dump(data, file) + with open('${{ inputs.plan_folder }}/_custom.yml', 'w') as file: + yaml.dump(data, file) + + - name: 'Create first testplan archive' + if: always() + id: begin_report + uses: OXID-eSales/github-actions/begin_report@v4 + with: + title: ${{ steps.ltp.outputs.finish_slack_title }} + prefix: '${{ steps.post_ltp.outputs.title }}' + repository: '${{ github.server_url }}/${{ github.repository }}' + job: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + testplan: '${{ inputs.testplan }}' + files: | + ${{ inputs.plan_folder}}/* + generated_testplan.yaml + generated_output.txt + generated_env.txt + load_testplan_init.log + debug: ${{ inputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ steps.post_ltp.outputs.title }}' + header: true + phase: install + priority: '001' + cached_object: ${{ steps.ltp.outputs.init_cache_name }} + debug: false + github_token: ${{ secrets.enterprise_github_token || github.token }} + + outputs: + debug: ${{ steps.begin_report.outputs.debug }} + use_private_cache: ${{ inputs.runs_on != '"ubuntu-latest"'}} + global_title: ${{ steps.post_ltp.outputs.title }} + # init variables + testplan: ${{ steps.consolidate_plans.outputs.testplan }} + init_cache_bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + init_cache_name: ${{ steps.ltp.outputs.init_cache_name }} + # install variables + install_matrix_mysql: ${{ steps.ltp.outputs.install_matrix_mysql }} + install_matrix_php: ${{ steps.ltp.outputs.install_matrix_php }} + install_max_parallel: ${{ steps.ltp.outputs.install_max_parallel }} + # runscript variables + runscript_matrix_mysql: ${{ steps.ltp.outputs.runscript_matrix_mysql }} + runscript_matrix_php: ${{ steps.ltp.outputs.runscript_matrix_php }} + runscript_matrix_script: ${{ steps.ltp.outputs.runscript_matrix_script }} + runscript_max_parallel: ${{ steps.ltp.outputs.runscript_max_parallel }} + # runslim variables + runslim_matrix_mysql: ${{ steps.ltp.outputs.runslim_matrix_mysql }} + runslim_matrix_php: ${{ steps.ltp.outputs.runslim_matrix_php }} + runslim_matrix_script: ${{ steps.ltp.outputs.runslim_matrix_script }} + runslim_max_parallel: ${{ steps.ltp.outputs.runslim_max_parallel }} + # sonarcloud variables + sonarcloud_matrix_mysql: ${{ steps.ltp.outputs.sonarcloud_matrix_mysql }} + sonarcloud_matrix_php: ${{ steps.ltp.outputs.sonarcloud_matrix_php }} + sonarcloud_matrix_testplan: ${{ steps.ltp.outputs.sonarcloud_matrix_testplan }} + sonarcloud_max_parallel: ${{ steps.ltp.outputs.sonarcloud_max_parallel }} + # yamllint variables + yamllint_skip: ${{ steps.ltp.outputs.yamllint_skip }} + yamllint_file_or_dir: ${{ steps.ltp.outputs.yamllint_file_or_dir }} + yamllint_rules: ${{ steps.ltp.outputs.yamllint_rules }} + # actionlint variables + actionlint_skip: ${{ steps.ltp.outputs.actionlint_skip }} + # finish variables + finish_matrix_mysql: ${{ steps.ltp.outputs.finish_matrix_mysql }} + finish_matrix_php: ${{ steps.ltp.outputs.finish_matrix_php }} + finish_skip: ${{ steps.ltp.outputs.finish_skip }} + finish_slack_title: ${{ steps.ltp.outputs.finish_slack_title }} + finish_slack_compact: ${{ steps.ltp.outputs.finish_slack_compact }} + + install: + needs: init + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.install_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.install_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.install_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + + steps: + - name: Load cached testplan + id: itn + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: '' + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: iltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.itn.outputs.testplan}}' + set_output: true + set_print: true + set_env: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_install.log + token: ${{ secrets.enterprise_github_token }} + + - name: 'Prepare Shop' + id: prepare_shop + uses: 'OXID-eSales/github-actions/prepare_shop@v4' + with: + container_name: ${{ steps.iltp.outputs.install_container_name }} + container_options: ${{ steps.iltp.outputs.install_container_options }} + container_method: ${{ steps.iltp.outputs.install_container_method }} + docker_login: ${{ steps.iltp.outputs.install_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + # Deprecated, use git_sdk_repository instead. This will be removed in in v5 + git_sdk_url: ${{ steps.iltp.outputs.install_git_sdk_url }} + git_sdk_repository: ${{ steps.iltp.outputs.install_git_sdk_repository }} + git_sdk_ref: ${{ steps.iltp.outputs.install_git_sdk_ref }} + # Deprecated, use git_repository instead. This will be removed in in v5 + git_shop_url: ${{ steps.iltp.outputs.install_git_shop_url }} + # Deprecated, use git_ref instead. This will be removed in in v5 + git_shop_ref: ${{ steps.iltp.outputs.install_git_shop_ref }} + git_repository: ${{ steps.iltp.outputs.install_git_repository }} + git_ref: ${{ steps.iltp.outputs.install_git_ref }} + compilation_url: ${{ steps.iltp.outputs.install_composer_root_url }} + github_ref_name: ${{ github.ref_name }} + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + custom_ini_error_reporting: ${{ steps.iltp.outputs.install_custom_ini_error_reporting }} + custom_ini_xdebug: ${{ steps.iltp.outputs.install_custom_ini_xdebug }} + add_services: ${{ steps.iltp.outputs.install_add_services }} + composer_file: ${{ steps.iltp.outputs.install_composer_file }} + composer_transform: ${{ steps.iltp.outputs.install_composer_transform}} + composer_backup: ${{ steps.iltp.outputs.install_composer_backup}} + composer_update: ${{ steps.iltp.outputs.install_composer_update}} + 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 + shell: bash + run: | + git clone --depth=1 --quiet --branch v1 https://github.com/joernott/load_testplan.git load_testplan + LOAD_TESTPLAN=$(find ./load_testplan -iname 'main-linux-amd64-*') + chmod a+x "${LOAD_TESTPLAN}" + PREFIXES=$(echo '${{steps.iltp.outputs.runscript_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq) + for PREFIX in ${PREFIXES}; do + VAR="runscript_${PREFIX}_path" + COMPOSER_PATH="${!VAR}" + VAR="runscript_${PREFIX}_composer_transform" + COMPOSER_TRANSFORM="${!VAR}" + VAR="runscript_${PREFIX}_composer_early" + EARLY="${!VAR}" + [ -z "${EARLY}" ] && EARLY="${runscript_composer_early}" + E="runscript_${PREFIX}_composer_early=='${EARLY}'" + if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then + echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m" + else + if [ -n "${COMPOSER_TRANSFORM}" ]; then + echo -e "\033[0;35mtransforming composer.json for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path'\033[0m" + echo "${COMPOSER_TRANSFORM}" > .composer_merge.tmp.json + export INPUT_FILES="source/${COMPOSER_PATH}/composer.json,.composer_merge.tmp.json" + export INPUT_INPUT_TYPE="json" + export INPUT_JSON="source/${COMPOSER_PATH}/composer.json" + "${LOAD_TESTPLAN}" + unset INPUT_FILES INPUT_INPUT_TYPE INPUT_JSON + rm .composer_merge.tmp.json + fi + echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path, ${E}'\033[0m" + 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 + PREFIXES=$(echo '${{steps.iltp.outputs.runslim_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq) + for PREFIX in ${PREFIXES}; do + VAR="runslim_${PREFIX}_path" + COMPOSER_PATH="${!VAR}" + VAR="runslim_${PREFIX}_composer_transform" + COMPOSER_TRANSFORM="${!VAR}" + VAR="runslim_${PREFIX}_composer_early" + EARLY="${!VAR}" + [ -z "${EARLY}" ] && EARLY="${runslim_composer_early}" + E="runslim_${PREFIX}_composer_early=='${EARLY}'" + if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then + echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m" + else + if [ -n "${COMPOSER_TRANSFORM}" ]; then + echo -e "\033[0;35mtransforming composer.json for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path'\033[0m" + echo "${COMPOSER_TRANSFORM}" > .composer_merge.tmp.json + export INPUT_FILES="source/${COMPOSER_PATH}/composer.json,.composer_merge.tmp.json" + export INPUT_INPUT_TYPE="json" + export INPUT_JSON="source/${COMPOSER_PATH}/composer.json" + "${LOAD_TESTPLAN}" + unset INPUT_FILES INPUT_INPUT_TYPE INPUT_JSON + 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_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 + rm -rf ./load_testplan + + - name: Generate debugging script for running composer for each module + if: ${{ inputs.debug == true }} + shell: bash + run: | + echo "banner 'Run composer for each module'" >>debug/debug.sh + PREFIXES=$(echo '${{steps.iltp.outputs.runscript_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq) + echo -e "\033[0;35mUnique prefixes: ${PREFIXES}\033[0m" + for PREFIX in ${PREFIXES}; do + VAR="runscript_${PREFIX}_path" + COMPOSER_PATH="${!VAR}" + VAR="runscript_${PREFIX}_composer_transform" + COMPOSER_TRANSFORM="${!VAR}" + VAR="runscript_${PREFIX}_composer_early" + EARLY="${!VAR}" + [ -z "${EARLY}" ] && EARLY="${runscript_composer_early}" + E="runscript_${PREFIX}_composer_early=='${EARLY}'" + if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then + cat >>debug/debug.sh <>debug/debug.sh <"source/${COMPOSER_PATH}/composer.json" <<'EOF' + ${JSON} + EOF + EODS + fi + cat >>debug/debug.sh <>debug/debug.sh <>debug/debug.sh <"source/${COMPOSER_PATH}/composer.json" <<'EOF' + ${JSON} + EOF + EODS + fi + cat >>debug/debug.sh <>debug/debug.sh <>debug/debug.sh + + - name: 'Start shop after caching preparedShop' + if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' }} + shell: bash + run: | + # install: Start containers + ${{ needs.init.outputs.debug }} + echo -e "\033[0;35m### Starting containers\033[0m" + make up + + - name: 'Install shop (legacy)' + if: ${{ steps.iltp.outputs.install_method == 'legacy' && steps.iltp.outputs.install_skip_shop_installation == 'false' }} + uses: 'OXID-eSales/github-actions/install_shop@v4' + with: + container_name: ${{ steps.iltp.outputs.install_container_name }} + container_options: ${{ steps.iltp.outputs.install_container_options }} + container_method: ${{ steps.iltp.outputs.install_container_method }} + is_enterprise: ${{ steps.iltp.outputs.install_is_enterprise }} + config_idebug: ${{ steps.iltp.outputs.install_config_idebug }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Debug Install shop (script)' + if: ${{ steps.iltp.outputs.install_method == 'script' && steps.iltp.outputs.install_skip_shop_installation == 'false' }} + run: | + echo "banner 'Install shop (script)'" >>debug/debug.sh + VARS=$(env|grep -E "^global_|^install_|^custom_|^secrets_"|grep -v "^install_shop_with_modules_"|grep -v "|_transform=") + IFS=$'\n' + while read -r E ; do + IFS='=' read -ra EXP <<< "$E" + VAL=("${EXP[@]:1}") + # shellcheck disable=SC2145 + echo "export ${EXP[0]}='${VAL[@]}'" >>debug/debug.sh + done <<< "$VARS" + cat >>debug/debug.sh <<'EOF' + SCRIPT="${{ steps.iltp.outputs.install_script }}" + if [ -f "${SCRIPT}" ]; then + chmod a+x "${SCRIPT}" + "${SCRIPT}" + else + echo -e "\033[0;31mCould not find ${SCRIPT}\033[0m" + exit 1 + fi + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + EOF + + - name: 'Install shop (script)' + if: ${{ steps.iltp.outputs.install_method == 'script' && steps.iltp.outputs.install_skip_shop_installation == 'false' }} + run: | + SCRIPT="${{ steps.iltp.outputs.install_script }}" + if [ -f "${SCRIPT}" ]; then + chmod a+x "${SCRIPT}" + "${SCRIPT}" + else + echo -e "\033[0;31mCould not finds ${SCRIPT}\033[0m" + exit 1 + fi + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + + - name: Activate modules + if: ${{ steps.iltp.outputs.install_skip_shop_installation == 'false' }} + shell: bash + run: | + # Activate modules + ${{ needs.init.outputs.debug }} + if [ -f 'source/bin/oe-console' ]; then + OE_CONSOLE='bin/oe-console' + else + if [ -f 'source/vendor/bin/oe-console' ]; then + OE_CONSOLE='vendor/bin/oe-console' + else + echo -e "\033[0;31mCan't find oe-console in bin or vendor/bin!\033[0m" + exit 1 + fi + fi + MODULES=$(echo -n "${{ steps.iltp.outputs.install_activate_modules }}"| tr '\n' ' ') + for MODULE in ${MODULES}; do + echo -e "\033[0;35m### activating module ${MODULE} ###\033[0m" + docker compose ${{ steps.iltp.outputs.install_container_method }} -T \ + ${{ steps.iltp.outputs.install_container_options }} \ + ${{ steps.iltp.outputs.install_container_name}} \ + ${OE_CONSOLE} oe:module:activate "${MODULE}" + done + + - name: Write files list + if: always() + shell: bash + run: | + # install: Write files list + find . >files.txt + # Compensate for multiline problems + { + echo 'ARTIFACT_PATHS<> "${GITHUB_ENV}" + + - name: Upload configuration artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: '${{ steps.iltp.outputs.install_output_artifact_prefix }}-${{steps.itn.outputs.matrix_suffix}}' + path: |- + docker*.log + files.txt + generated_testplan.yaml + load_testplan_install.log + ${{ env.ARTIFACT_PATHS }} + + - name: Run custom scripts + # yamllint disable-line rule:line-length + if: ${{ steps.iltp.outputs.install_custom_script != '' || steps.iltp.outputs.install_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.iltp.outputs.install_container_name }} + container_options: ${{ steps.iltp.outputs.install_container_options }} + container_method: ${{ steps.iltp.outputs.install_container_method }} + custom_script: ${{ steps.iltp.outputs.install_custom_script }} + custom_script_container: ${{ steps.iltp.outputs.install_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Debug cache current installation + if: ${{ inputs.debug }} + shell: bash + run: | + # install: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + MATRIX='PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + CACHE_NAME="${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.iltp.outputs.global_title}}-${MATRIX}" + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: Cache current installation on s3 + if: ${{ needs.init.outputs.use_private_cache == 'true' }} + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.itn.outputs.matrix_suffix}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.iltp.outputs.install_cache_bucket }} + + - name: Cache current installation on github + if: ${{ needs.init.outputs.use_private_cache != 'true' }} + uses: actions/cache/save@v4 + with: + path: | + ./* + key: '${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.itn.outputs.matrix_suffix}}' + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '020' + phase: install + job: install + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + # yamllint disable rule:line-length + cached_object: | + ${{ steps.iltp.outputs.install_cache_prepared_shop_prefix}}_${{steps.iltp.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}} + ${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.iltp.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}} + # yamllint enable rule:line-length + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + runscript: + needs: ['init', 'install'] + if: ${{ needs.init.outputs.runscript_matrix_script != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.runscript_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.runscript_matrix_mysql) }} + script: ${{ fromJSON(needs.init.outputs.runscript_matrix_script) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.runscript_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + steps: + - name: Load cached testplan + id: rstn + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: '' + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: rsltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.rstn.outputs.testplan}}' + set_output: true + set_print: true + set_env: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_runscript.log + token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Convert variables + id: rt + shell: bash + run: | + ${{ needs.init.outputs.debug }} + set +x + E=$(env|grep -e "^runscript_") + MATRIX_SCRIPT='${{ matrix.script }}' + if [[ ${MATRIX_SCRIPT} != *":"* ]]; then + echo -e "\033[0;31m ${X} does not contain a ':'. You need to specify scripts as ':'" + exit 1 + fi + IFS=':' read -r -a S <<< "${MATRIX_SCRIPT}" + PREFIX="${S[0]//-/_}" + SCRIPT="${S[1]}" + echo "runscript_script=${SCRIPT}"|tee -a "${GITHUB_OUTPUT}" + for KEY in docker_login load_shop \ + container_name container_options container_method \ + cache_bucket \ + composer_file composer_backup composer_transform composer_update composer_update_options composer_early \ + custom_script custom_script_container \ + path install_options \ + output_prefix coverage_prefix; do + VAR="runscript_${PREFIX}_${KEY}" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR="runscript_${KEY}" + fi + echo "runscript_${KEY}=${!VAR}" + cat >>"${GITHUB_OUTPUT}" <|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \ + tee -a "${GITHUB_OUTPUT}" + echo "runscript_title=${PREFIX}_${SCRIPT}"| \ + sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' | \ + tee -a "${GITHUB_OUTPUT}" + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.rt.outputs.runscript_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.rt.outputs.runscript_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.rt.outputs.runscript_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + wait_for_selenium: true + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + # Also run this if there is a transformation but composer_early is set to 'skip' + if: ${{ steps.rt.outputs.runscript_composer_transform != '' && steps.rt.outputs.runscript_composer_early != 'true' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/${{ steps.rt.outputs.runscript_path }}/composer.json' + backup: true + transform: | + ${{ steps.rt.outputs.runscript_composer_transform }} + update: ${{ steps.rt.outputs.runscript_composer_update }} + update_options: '${{ steps.rt.outputs.runscript_composer_update_options }} -d /var/www/${{ steps.rt.outputs.runscript_path }}' + container_name: ${{ steps.rt.outputs.runscript_container_name }} + container_options: ${{ steps.rt.outputs.runscript_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run composer if there is no transform + # Only run this if there is no transformation and composer_early is set to 'false' + if: ${{ steps.rt.outputs.runscript_composer_transform == '' && steps.rt.outputs.runscript_composer_early == 'false' }} + run: | + # run composer + ${{ inputs.debug }} + docker compose exec -T \ + ${{ steps.rt.outputs.runscript_container_options }} \ + ${{ steps.rt.outputs.runscript_container_name }} \ + composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}" + docker compose exec -T \ + ${{ steps.rt.outputs.runscript_container_options }} \ + ${{ steps.rt.outputs.runscript_container_name }} \ + composer update --no-interaction -d "/var/www/${{ steps.rt.outputs.runscript_path }}" + + - name: Run custom scripts + if: ${{ steps.rt.outputs.runscript_custom_script != '' || steps.rt.outputs.runscript_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.rt.outputs.runscript_container_name }} + container_options: ${{ steps.rt.outputs.runscript_container_options }} + container_method: ${{ steps.rt.outputs.runscript_container_method }} + custom_script: ${{ steps.rt.outputs.runscript_custom_script }} + custom_script_container: ${{ steps.rt.outputs.runscript_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + token: ${{ github.token }} + + - name: 'Run runscript check' + uses: 'OXID-eSales/github-actions/run_test_script@v4' + 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 }} + container_options: ${{ steps.rt.outputs.runscript_container_options }} + container_method: ${{ steps.rt.outputs.runscript_container_method }} + output_artifact: ${{ steps.rt.outputs.runscript_output_prefix}}-${{steps.rt.outputs.runscript_suffix }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Upload coverage report + if: ${{ always() && steps.rt.outputs.runscript_coverage_prefix != '' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.rt.outputs.runscript_coverage_prefix}}-${{steps.rt.outputs.runscript_suffix }} + path: source/${{ steps.rt.outputs.runscript_path }}/tests/Reports/* + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '100' + phase: test + job: runscript + title: '${{ steps.rt.outputs.runscript_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + runslim: + needs: ['init', 'install'] + if: ${{ needs.init.outputs.runslim_matrix_script != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.runslim_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.runslim_matrix_mysql) }} + script: ${{ fromJSON(needs.init.outputs.runslim_matrix_script) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.runslim_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + steps: + - name: Load cached testplan + id: rstn + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: '' + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: rsltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.rstn.outputs.testplan}}' + set_output: true + set_print: true + set_env: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_runslim.log + token: ${{ secrets.enterprise_github_token }} + + - name: Convert variables + id: rt + shell: bash + run: | + ${{ needs.init.outputs.debug }} + set +x + E=$(env|grep -e "^runslim_") + MATRIX_SCRIPT='${{ matrix.script }}' + if [[ ${MATRIX_SCRIPT} != *":"* ]]; then + echo -e "\033[0;31m ${X} does not contain a ':'. You need to specify scripts as ':'" + exit 1 + fi + IFS=':' read -r -a S <<< "${MATRIX_SCRIPT}" + PREFIX="${S[0]//-/_}" + SCRIPT="${S[1]}" + echo "runslim_script=${SCRIPT}"|tee -a "${GITHUB_OUTPUT}" + for KEY in docker_login load_shop \ + container_name container_options container_method \ + cache_bucket \ + composer_file composer_backup composer_transform composer_update composer_update_options composer_early \ + custom_script custom_script_container \ + path install_options \ + output_prefix coverage_prefix; do + VAR="runslim_${PREFIX}_${KEY}" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR="runslim_${KEY}" + fi + echo "runslim_${KEY}=${!VAR}" + cat >>"${GITHUB_OUTPUT}" <|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" + echo "runslim_title=${PREFIX}_${SCRIPT}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.rt.outputs.runslim_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.rt.outputs.runslim_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.rt.outputs.runslim_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + wait_for_selenium: true + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.rt.outputs.runslim_composer_transform != '' && steps.rt.outputs.runslim_composer_early == 'false' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/${{ steps.rt.outputs.runslim_path }}/composer.json' + backup: true + transform: | + ${{ steps.rt.outputs.runslim_composer_transform }} + update: ${{ steps.rt.outputs.runslim_composer_update }} + update_options: '${{ steps.rt.outputs.runslim_composer_update_options }} -d /var/www/${{ steps.rt.outputs.runslim_path }}' + container_name: ${{ steps.rt.outputs.runslim_container_name }} + container_options: ${{ steps.rt.outputs.runslim_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run composer if there is no transform + if: ${{ steps.rt.outputs.runslim_composer_transform == '' && steps.rt.outputs.runslim_composer_early == 'false' }} + run: | + # run composer + ${{ inputs.debug }} + docker compose exec -T \ + ${{ steps.rt.outputs.runslim_container_options }} \ + ${{ steps.rt.outputs.runslim_container_name }} \ + composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}" + docker compose exec -T \ + ${{ steps.rt.outputs.runslim_container_options }} \ + ${{ steps.rt.outputs.runslim_container_name }} \ + composer update --no-interaction -d "/var/www/${{ steps.rt.outputs.runslim_path }}" + + - name: Run custom scripts + if: ${{ steps.rt.outputs.runslim_custom_script != '' || steps.rt.outputs.runslim_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.rt.outputs.runslim_container_name }} + container_options: ${{ steps.rt.outputs.runslim_container_options }} + container_method: ${{ steps.rt.outputs.runslim_container_method }} + custom_script: ${{ steps.rt.outputs.runslim_custom_script }} + custom_script_container: ${{ steps.rt.outputs.runslim_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run runslim check' + uses: 'OXID-eSales/github-actions/run_test_script@v4' + 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 }} + container_options: ${{ steps.rt.outputs.runslim_container_options }} + container_method: ${{ steps.rt.outputs.runslim_container_method }} + output_artifact: ${{ steps.rt.outputs.runslim_output_prefix}}-${{steps.rt.outputs.runslim_suffix }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Upload coverage report + if: ${{ always() && steps.rt.outputs.runslim_coverage_prefix != '' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.rt.outputs.runslim_coverage_prefix}}-${{steps.rt.outputs.runslim_suffix }} + path: source/${{ steps.rt.outputs.runslim_path }}/tests/Reports/* + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '100' + phase: test + job: runslim + title: '${{ steps.rt.outputs.runslim_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + sonarcloud: + needs: ['init', 'install', 'runscript', 'runslim'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.sonarcloud_matrix_testplan != '' && needs.init.outputs.sonarcloud_matrix_testplan != 'none' && needs.init.outputs.sonarcloud_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.sonarcloud_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + steps: + - name: Warn if sonarcloud secret is missing + if: ${{ env.SONAR_TOKEN == '' }} + run: | + echo "::warning title=Missing secrets::Please set the repository secrets SONAR_TOKEN to run sonarcloud scans" + + - name: Load cached testplan + id: sonarcloud_testplan_name + if: ${{ env.SONAR_TOKEN != '' }} + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: sonarcloud_testplan + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.sonarcloud_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_sonarcloud.log + token: ${{ secrets.enterprise_github_token }} + + - name: Checkout shop + if: ${{ env.SONAR_TOKEN != '' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_repository }}' + ref: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_ref }}' + token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Login to Docker Hub + env: + DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} + if: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_docker_login == 'true' && env.DOCKER_HUB_USER != '' }} + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: 'SonarCloud Scan' + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'OXID-eSales/github-actions/sonarcloud@v4' + with: + coverage_artifact: 'coverage-reports-*-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' + output_artifact: 'coverage-reports-${{ needs.init.outputs.global_title }}' + target_branch: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_target_branch }} + strip_path: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_strip_path }} + github_ref_name: ${{ github.ref_name }} + sonarcloud_organization: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_organization }} + sonarcloud_project_key: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_key }} + sonarcloud_project_name: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_name }} + sonarcloud_parameters: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_parameters }} + sonar_token: ${{ secrets.SONAR_TOKEN }} + github_token: ${{ github.token }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + job: sonarcloud + title: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + yamllint: + needs: ['init', 'install'] + if: ${{ always() && needs.init.outputs.yamllint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Lint yaml files + id: yamllint + uses: OXID-eSales/github-actions/yamllint@v4 + with: + file_or_dir: ${{ needs.init.outputs.yamllint_file_or_dir }} + config_data: ${{ needs.init.outputs.yamllint_rules }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write yamllint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + title: '' + job: 'yamllint' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + github_token: ${{ secrets.enterprise_github_token || github.token }} + + actionlint: + needs: ['init', 'install'] + if: ${{ always() && needs.init.outputs.actionlint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Install npm on private runner + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + run: | + NPM=$(type -p 'npm'||true) + 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 python3-venv + fi + + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Run actionlint + id: actionlint + uses: raven-actions/actionlint@v2 + + - name: actionlint Summary + if: always() + run: | + echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}" + echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}" + echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code" + echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'" + echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors" + echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files" + echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}" + + - name: 'Write actionlint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '250' + phase: report + job: 'actionlint' + title: '' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + github_token: ${{ secrets.enterprise_github_token || github.token }} + + finish: + if: ${{ always() && needs.init.outputs.finish_skip != 'true' }} + needs: + - init + - install + - runscript + - runslim + - sonarcloud + - yamllint + - actionlint + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Choose Slack channel + id: slack + shell: bash + run: | + if [ "${{ inputs.use_scheduled_slack_channel }}" == "false" ]; then + echo "webhook=${{ secrets.SLACK_WEBHOOK_URL }}" >>"${GITHUB_OUTPUT}" + else + echo "webhook=${{ secrets.SLACK_SCHEDULED_WEBHOOK_URL }}" >>"${GITHUB_OUTPUT}" + fi + - name: 'Generate report' + id: generate_report + uses: 'OXID-eSales/github-actions/generate_report@v4' + with: + prefix: '${{ needs.init.outputs.global_title }}' + slack_webhook: ${{ steps.slack.outputs.webhook }} + title: '${{ needs.init.outputs.finish_slack_title }}' + compact: '${{ needs.init.outputs.finish_slack_compact }}' + debug: ${{ inputs.debug }} + + - name: 'Checkout the repo for cleanup' + uses: actions/checkout@v4 + with: + path: repo + + - name: 'Clean Cache' + # if: ${{ steps.generate_report.outputs.overall_status == 'success' }} + uses: 'OXID-eSales/github-actions/clean_cache@v4' + env: + GH_TOKEN: ${{ github.token }} + with: + path: repo + runs_on: ${{ inputs.runs_on }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_objects: | + ${{ steps.generate_report.outputs.cache_objects }} + debug: ${{ needs.init.outputs.debug }} diff --git a/.github/workflows/universal_workflow_light.yml b/.github/workflows/universal_workflow_light.yml index 90058082..5e6fb6e8 100644 --- a/.github/workflows/universal_workflow_light.yml +++ b/.github/workflows/universal_workflow_light.yml @@ -1179,6 +1179,15 @@ jobs: ref: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_ref }}' token: ${{ secrets.enterprise_github_token || github.token }} + - name: Login to Docker Hub + env: + DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} + if: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_docker_login == 'true' && env.DOCKER_HUB_USER != '' }} + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + - name: 'SonarCloud Scan' if: ${{ env.SONAR_TOKEN != '' }} uses: 'OXID-eSales/github-actions/sonarcloud@v4' diff --git a/.github/workflows/universal_workflow_light.yml.backup b/.github/workflows/universal_workflow_light.yml.backup new file mode 100644 index 00000000..5e6fb6e8 --- /dev/null +++ b/.github/workflows/universal_workflow_light.yml.backup @@ -0,0 +1,1357 @@ +name: universal_workflow_light +# This workflow loads a base testplan, creates cached shop instances and runs +# phpunit, codeception and runtest based tests as well as code scans +# and sonarcloud reports +# +# yamllint disable-line rule:truthy +on: + workflow_call: + inputs: + testplan: + type: string + description: 'Testplan to run' + required: true + runs_on: + type: string + description: 'JSON string/array describing the runner' + required: true + defaults: + type: string + description: 'Which ref do we want to use for the plan defaults' + required: false + default: 'v3' + plan_folder: + type: string + description: 'Folder containing the test plans' + required: false + default: 'tests/github_actions' + default_plan_folder: + type: string + description: 'Folder containing the test plan templates' + required: false + default: '.github/oxid-esales/defaults' + debug: + type: boolean + description: 'Enable debugging' + default: true + required: false + custom_testplan_yaml: + type: string + description: 'Content of ~/oxid-esales/_custom.yaml' + default: '' + required: false + use_scheduled_slack_channel: + type: boolean + description: 'Use alternative slack channel' + default: false + required: false + + secrets: + DOCKER_HUB_USER: + # description: 'user for the docker login' + required: false + DOCKER_HUB_TOKEN: + # description: 'Token for the docker login' + required: false + CACHE_ENDPOINT: + # description: 'Endpoint for tespkg/actions-cache@v1' + required: false # only for ee + CACHE_ACCESS_KEY: + # description: 'Access key for tespkg/actions-cache@v1' + required: false # only for ee + CACHE_SECRET_KEY: + # description: 'Secret key for tespkg/actions-cache@v1' + required: false # only for ee + enterprise_github_token: + # description: 'OAuth token to access enterprise repos' + required: false + SONAR_TOKEN: + # description: Token for sonarcloud access + required: false + SLACK_WEBHOOK_URL: + required: false + # description: Webhook for posting to SLACK + SLACK_SCHEDULED_WEBHOOK_URL: + required: false + # description: Webhook for posting to SLACK + +jobs: + init: + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: 'Checkout testplan defaults' + uses: actions/checkout@v4 + with: + repository: 'OXID-eSales/github-actions' + ref: '${{ inputs.defaults }}' + path: 'defaults' + sparse-checkout: '${{ inputs.default_plan_folder }}' + + - name: 'Checkout testplans' + uses: actions/checkout@v4 + with: + sparse-checkout: | + ${{ inputs.plan_folder}} + composer.json + path: workflow + + - name: 'Consolidate plans' + id: consolidate_plans + run: | + mkdir -p '${{ inputs.plan_folder }}/defaults' + if [ -d workflow/${{ inputs.plan_folder }} ]; then + mv workflow/${{ inputs.plan_folder }}/* '${{ inputs.plan_folder }}/' + /bin/rm -r 'workflow/${{ inputs.plan_folder }}' + fi + if [ -f workflow/composer.json ]; then + mv workflow/composer.json '${{ inputs.plan_folder }}/' + fi + mv defaults/${{ inputs.default_plan_folder}}/* '${{ inputs.plan_folder }}/defaults/' + cat >'${{ inputs.plan_folder }}/_custom.yaml' <<'EOF' + # Generated from workflow input custom_testplan_yaml + ${{ inputs.custom_testplan_yaml }} + EOF + # ToDo: The next line can be removed in v5 when the transition to yaml is finished + cp '${{ inputs.plan_folder }}/_custom.yaml' '${{ inputs.plan_folder }}/_custom.yml' + if [ '${{ github.event_name }}' == 'pull_request' ]; then + REF=$(echo '{{ .Github.HeadRef }}'|sed -e 's|/refs/heads/||') + # This is the git ref name + sed -e "s|safe_ref_name:.*|safe_ref_name: ${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml' + # This is the same for composer but with an added dev- prefix + sed -e "s|ref_name: dev-.*|ref_name: dev-${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml' + fi + + TESTPLAN=$(echo "${{ inputs.testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g') + # ToDo: Remove the ,${{ inputs.plan_folder }}/defaults/_rename.yaml when releasing v5 + DEFAULTS="${{ inputs.plan_folder }}/defaults/defaults_light.yaml" + echo "testplan=${DEFAULTS},${TESTPLAN},${{ inputs.plan_folder }}/defaults/_rename.yaml" >>"${GITHUB_OUTPUT}" + + - name: 'Load Testplan' + id: ltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{ steps.consolidate_plans.outputs.testplan }}' + set_output: true + set_env: true + set_print: true + loglevel: info + logfile: load_testplan_init.log + yaml: generated_testplan.yaml + + - name: 'Prepare artifact and generate safe title' + id: post_ltp + if: always() + run: | + cp "${GITHUB_OUTPUT}" generated_output.txt + cp "${GITHUB_ENV}" generated_env.txt + echo 'title=${{steps.ltp.outputs.global_title}}'| \ + sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \ + tee -a "${GITHUB_OUTPUT}" + + - name: Cache testplan on S3 + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + uses: tespkg/actions-cache/save@v1 + with: + path: | + ${{ inputs.plan_folder }}/* + key: '${{ steps.ltp.outputs.init_cache_name }}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + + - name: Cache testplan on Github + if: ${{ inputs.runs_on == '"ubuntu-latest"'}} + uses: actions/cache/save@v4 + with: + path: | + ${{ inputs.plan_folder }}/* + key: '${{ steps.ltp.outputs.init_cache_name }}' + + - name: Install missing python3-yaml on private runners + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + shell: bash + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update + sudo apt-get -qq install python3-yaml + + - name: Obfuscate _custom yaml + if: always() + shell: python + run: | + import yaml + + def obfuscate(d): + for k, v in d.items(): + if isinstance(v, dict): + obfuscate(v) + else: + d[k]='***' + return d + + with open('${{ inputs.plan_folder }}/_custom.yaml','r') as f: + data = yaml.safe_load(f) + if isinstance(data, dict): + if 'secrets' in data: + data['secrets']=obfuscate(data['secrets']) + with open('${{ inputs.plan_folder }}/_custom.yaml', 'w') as file: + yaml.dump(data, file) + with open('${{ inputs.plan_folder }}/_custom.yml', 'w') as file: + yaml.dump(data, file) + + - name: 'Create first testplan archive' + if: always() + id: begin_report + uses: OXID-eSales/github-actions/begin_report@v4 + with: + title: ${{ steps.ltp.outputs.finish_slack_title }} + prefix: '${{ steps.post_ltp.outputs.title }}' + repository: '${{ github.server_url }}/${{ github.repository }}' + job: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + testplan: '${{ inputs.testplan }}' + files: | + ${{ inputs.plan_folder}}/* + generated_testplan.yaml + generated_output.txt + generated_env.txt + load_testplan_init.log + debug: ${{ inputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ steps.post_ltp.outputs.title }}' + header: true + phase: install + priority: '001' + cached_object: ${{ steps.ltp.outputs.init_cache_name }} + debug: false + github_token: ${{ secrets.enterprise_github_token || github.token }} + + outputs: + debug: ${{ steps.begin_report.outputs.debug }} + use_private_cache: ${{ inputs.runs_on != '"ubuntu-latest"'}} + global_title: ${{ steps.post_ltp.outputs.title }} + # init variables + testplan: ${{ steps.consolidate_plans.outputs.testplan }} + init_cache_bucket: ${{ steps.ltp.outputs.init_cache_bucket }} + init_cache_name: ${{ steps.ltp.outputs.init_cache_name }} + # install variables + install_matrix_mysql: ${{ steps.ltp.outputs.install_matrix_mysql }} + install_matrix_php: ${{ steps.ltp.outputs.install_matrix_php }} + install_max_parallel: ${{ steps.ltp.outputs.install_max_parallel }} + # runscript variables + runscript_matrix_mysql: ${{ steps.ltp.outputs.runscript_matrix_mysql }} + runscript_matrix_php: ${{ steps.ltp.outputs.runscript_matrix_php }} + runscript_matrix_script: ${{ steps.ltp.outputs.runscript_matrix_script }} + runscript_max_parallel: ${{ steps.ltp.outputs.runscript_max_parallel }} + # runslim variables + runslim_matrix_mysql: ${{ steps.ltp.outputs.runslim_matrix_mysql }} + runslim_matrix_php: ${{ steps.ltp.outputs.runslim_matrix_php }} + runslim_matrix_script: ${{ steps.ltp.outputs.runslim_matrix_script }} + runslim_max_parallel: ${{ steps.ltp.outputs.runslim_max_parallel }} + # sonarcloud variables + sonarcloud_matrix_mysql: ${{ steps.ltp.outputs.sonarcloud_matrix_mysql }} + sonarcloud_matrix_php: ${{ steps.ltp.outputs.sonarcloud_matrix_php }} + sonarcloud_matrix_testplan: ${{ steps.ltp.outputs.sonarcloud_matrix_testplan }} + sonarcloud_max_parallel: ${{ steps.ltp.outputs.sonarcloud_max_parallel }} + # yamllint variables + yamllint_skip: ${{ steps.ltp.outputs.yamllint_skip }} + yamllint_file_or_dir: ${{ steps.ltp.outputs.yamllint_file_or_dir }} + yamllint_rules: ${{ steps.ltp.outputs.yamllint_rules }} + # actionlint variables + actionlint_skip: ${{ steps.ltp.outputs.actionlint_skip }} + # finish variables + finish_matrix_mysql: ${{ steps.ltp.outputs.finish_matrix_mysql }} + finish_matrix_php: ${{ steps.ltp.outputs.finish_matrix_php }} + finish_skip: ${{ steps.ltp.outputs.finish_skip }} + finish_slack_title: ${{ steps.ltp.outputs.finish_slack_title }} + finish_slack_compact: ${{ steps.ltp.outputs.finish_slack_compact }} + + install: + needs: init + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.install_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.install_matrix_mysql) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.install_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + + steps: + - name: Load cached testplan + id: itn + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: '' + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: iltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.itn.outputs.testplan}}' + set_output: true + set_print: true + set_env: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_install.log + token: ${{ secrets.enterprise_github_token }} + + - name: 'Prepare Shop' + id: prepare_shop + uses: 'OXID-eSales/github-actions/prepare_shop@v4' + with: + container_name: ${{ steps.iltp.outputs.install_container_name }} + container_options: ${{ steps.iltp.outputs.install_container_options }} + container_method: ${{ steps.iltp.outputs.install_container_method }} + docker_login: ${{ steps.iltp.outputs.install_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + # Deprecated, use git_sdk_repository instead. This will be removed in in v5 + git_sdk_url: ${{ steps.iltp.outputs.install_git_sdk_url }} + git_sdk_repository: ${{ steps.iltp.outputs.install_git_sdk_repository }} + git_sdk_ref: ${{ steps.iltp.outputs.install_git_sdk_ref }} + # Deprecated, use git_repository instead. This will be removed in in v5 + git_shop_url: ${{ steps.iltp.outputs.install_git_shop_url }} + # Deprecated, use git_ref instead. This will be removed in in v5 + git_shop_ref: ${{ steps.iltp.outputs.install_git_shop_ref }} + git_repository: ${{ steps.iltp.outputs.install_git_repository }} + git_ref: ${{ steps.iltp.outputs.install_git_ref }} + compilation_url: ${{ steps.iltp.outputs.install_composer_root_url }} + github_ref_name: ${{ github.ref_name }} + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + custom_ini_error_reporting: ${{ steps.iltp.outputs.install_custom_ini_error_reporting }} + custom_ini_xdebug: ${{ steps.iltp.outputs.install_custom_ini_xdebug }} + add_services: ${{ steps.iltp.outputs.install_add_services }} + composer_file: ${{ steps.iltp.outputs.install_composer_file }} + composer_transform: ${{ steps.iltp.outputs.install_composer_transform}} + composer_backup: ${{ steps.iltp.outputs.install_composer_backup}} + composer_update: ${{ steps.iltp.outputs.install_composer_update}} + 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 + shell: bash + run: | + git clone --depth=1 --quiet --branch v1 https://github.com/joernott/load_testplan.git load_testplan + LOAD_TESTPLAN=$(find ./load_testplan -iname 'main-linux-amd64-*') + chmod a+x "${LOAD_TESTPLAN}" + PREFIXES=$(echo '${{steps.iltp.outputs.runscript_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq) + for PREFIX in ${PREFIXES}; do + VAR="runscript_${PREFIX}_path" + COMPOSER_PATH="${!VAR}" + VAR="runscript_${PREFIX}_composer_transform" + COMPOSER_TRANSFORM="${!VAR}" + VAR="runscript_${PREFIX}_composer_early" + EARLY="${!VAR}" + [ -z "${EARLY}" ] && EARLY="${runscript_composer_early}" + E="runscript_${PREFIX}_composer_early=='${EARLY}'" + if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then + echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m" + else + if [ -n "${COMPOSER_TRANSFORM}" ]; then + echo -e "\033[0;35mtransforming composer.json for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path'\033[0m" + echo "${COMPOSER_TRANSFORM}" > .composer_merge.tmp.json + export INPUT_FILES="source/${COMPOSER_PATH}/composer.json,.composer_merge.tmp.json" + export INPUT_INPUT_TYPE="json" + export INPUT_JSON="source/${COMPOSER_PATH}/composer.json" + "${LOAD_TESTPLAN}" + unset INPUT_FILES INPUT_INPUT_TYPE INPUT_JSON + rm .composer_merge.tmp.json + fi + echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path, ${E}'\033[0m" + 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 + PREFIXES=$(echo '${{steps.iltp.outputs.runslim_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq) + for PREFIX in ${PREFIXES}; do + VAR="runslim_${PREFIX}_path" + COMPOSER_PATH="${!VAR}" + VAR="runslim_${PREFIX}_composer_transform" + COMPOSER_TRANSFORM="${!VAR}" + VAR="runslim_${PREFIX}_composer_early" + EARLY="${!VAR}" + [ -z "${EARLY}" ] && EARLY="${runslim_composer_early}" + E="runslim_${PREFIX}_composer_early=='${EARLY}'" + if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then + echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m" + else + if [ -n "${COMPOSER_TRANSFORM}" ]; then + echo -e "\033[0;35mtransforming composer.json for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path'\033[0m" + echo "${COMPOSER_TRANSFORM}" > .composer_merge.tmp.json + export INPUT_FILES="source/${COMPOSER_PATH}/composer.json,.composer_merge.tmp.json" + export INPUT_INPUT_TYPE="json" + export INPUT_JSON="source/${COMPOSER_PATH}/composer.json" + "${LOAD_TESTPLAN}" + unset INPUT_FILES INPUT_INPUT_TYPE INPUT_JSON + 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_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 + rm -rf ./load_testplan + + - name: Generate debugging script for running composer for each module + if: ${{ inputs.debug == true }} + shell: bash + run: | + echo "banner 'Run composer for each module'" >>debug/debug.sh + PREFIXES=$(echo '${{steps.iltp.outputs.runscript_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq) + echo -e "\033[0;35mUnique prefixes: ${PREFIXES}\033[0m" + for PREFIX in ${PREFIXES}; do + VAR="runscript_${PREFIX}_path" + COMPOSER_PATH="${!VAR}" + VAR="runscript_${PREFIX}_composer_transform" + COMPOSER_TRANSFORM="${!VAR}" + VAR="runscript_${PREFIX}_composer_early" + EARLY="${!VAR}" + [ -z "${EARLY}" ] && EARLY="${runscript_composer_early}" + E="runscript_${PREFIX}_composer_early=='${EARLY}'" + if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then + cat >>debug/debug.sh <>debug/debug.sh <"source/${COMPOSER_PATH}/composer.json" <<'EOF' + ${JSON} + EOF + EODS + fi + cat >>debug/debug.sh <>debug/debug.sh <>debug/debug.sh <"source/${COMPOSER_PATH}/composer.json" <<'EOF' + ${JSON} + EOF + EODS + fi + cat >>debug/debug.sh <>debug/debug.sh <>debug/debug.sh + + - name: 'Start shop after caching preparedShop' + if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' }} + shell: bash + run: | + # install: Start containers + ${{ needs.init.outputs.debug }} + echo -e "\033[0;35m### Starting containers\033[0m" + make up + + - name: 'Install shop (legacy)' + if: ${{ steps.iltp.outputs.install_method == 'legacy' && steps.iltp.outputs.install_skip_shop_installation == 'false' }} + uses: 'OXID-eSales/github-actions/install_shop@v4' + with: + container_name: ${{ steps.iltp.outputs.install_container_name }} + container_options: ${{ steps.iltp.outputs.install_container_options }} + container_method: ${{ steps.iltp.outputs.install_container_method }} + is_enterprise: ${{ steps.iltp.outputs.install_is_enterprise }} + config_idebug: ${{ steps.iltp.outputs.install_config_idebug }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Debug Install shop (script)' + if: ${{ steps.iltp.outputs.install_method == 'script' && steps.iltp.outputs.install_skip_shop_installation == 'false' }} + run: | + echo "banner 'Install shop (script)'" >>debug/debug.sh + VARS=$(env|grep -E "^global_|^install_|^custom_|^secrets_"|grep -v "^install_shop_with_modules_"|grep -v "|_transform=") + IFS=$'\n' + while read -r E ; do + IFS='=' read -ra EXP <<< "$E" + VAL=("${EXP[@]:1}") + # shellcheck disable=SC2145 + echo "export ${EXP[0]}='${VAL[@]}'" >>debug/debug.sh + done <<< "$VARS" + cat >>debug/debug.sh <<'EOF' + SCRIPT="${{ steps.iltp.outputs.install_script }}" + if [ -f "${SCRIPT}" ]; then + chmod a+x "${SCRIPT}" + "${SCRIPT}" + else + echo -e "\033[0;31mCould not find ${SCRIPT}\033[0m" + exit 1 + fi + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + EOF + + - name: 'Install shop (script)' + if: ${{ steps.iltp.outputs.install_method == 'script' && steps.iltp.outputs.install_skip_shop_installation == 'false' }} + run: | + SCRIPT="${{ steps.iltp.outputs.install_script }}" + if [ -f "${SCRIPT}" ]; then + chmod a+x "${SCRIPT}" + "${SCRIPT}" + else + echo -e "\033[0;31mCould not finds ${SCRIPT}\033[0m" + exit 1 + fi + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + + - name: Activate modules + if: ${{ steps.iltp.outputs.install_skip_shop_installation == 'false' }} + shell: bash + run: | + # Activate modules + ${{ needs.init.outputs.debug }} + if [ -f 'source/bin/oe-console' ]; then + OE_CONSOLE='bin/oe-console' + else + if [ -f 'source/vendor/bin/oe-console' ]; then + OE_CONSOLE='vendor/bin/oe-console' + else + echo -e "\033[0;31mCan't find oe-console in bin or vendor/bin!\033[0m" + exit 1 + fi + fi + MODULES=$(echo -n "${{ steps.iltp.outputs.install_activate_modules }}"| tr '\n' ' ') + for MODULE in ${MODULES}; do + echo -e "\033[0;35m### activating module ${MODULE} ###\033[0m" + docker compose ${{ steps.iltp.outputs.install_container_method }} -T \ + ${{ steps.iltp.outputs.install_container_options }} \ + ${{ steps.iltp.outputs.install_container_name}} \ + ${OE_CONSOLE} oe:module:activate "${MODULE}" + done + + - name: Write files list + if: always() + shell: bash + run: | + # install: Write files list + find . >files.txt + # Compensate for multiline problems + { + echo 'ARTIFACT_PATHS<> "${GITHUB_ENV}" + + - name: Upload configuration artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: '${{ steps.iltp.outputs.install_output_artifact_prefix }}-${{steps.itn.outputs.matrix_suffix}}' + path: |- + docker*.log + files.txt + generated_testplan.yaml + load_testplan_install.log + ${{ env.ARTIFACT_PATHS }} + + - name: Run custom scripts + # yamllint disable-line rule:line-length + if: ${{ steps.iltp.outputs.install_custom_script != '' || steps.iltp.outputs.install_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.iltp.outputs.install_container_name }} + container_options: ${{ steps.iltp.outputs.install_container_options }} + container_method: ${{ steps.iltp.outputs.install_container_method }} + custom_script: ${{ steps.iltp.outputs.install_custom_script }} + custom_script_container: ${{ steps.iltp.outputs.install_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: Debug cache current installation + if: ${{ inputs.debug }} + shell: bash + run: | + # install: Debug cache current installation + # we need to add the dot folders here explicitly because bash works differently than the action + MATRIX='PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' + CACHE_NAME="${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.iltp.outputs.global_title}}-${MATRIX}" + echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh + + - name: Cache current installation on s3 + if: ${{ needs.init.outputs.use_private_cache == 'true' }} + uses: tespkg/actions-cache/save@v1 + with: + path: | + ./* + key: '${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.itn.outputs.matrix_suffix}}' + endpoint: ${{ secrets.CACHE_ENDPOINT }} + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} + secretKey: ${{ secrets.CACHE_SECRET_KEY }} + bucket: ${{ steps.iltp.outputs.install_cache_bucket }} + + - name: Cache current installation on github + if: ${{ needs.init.outputs.use_private_cache != 'true' }} + uses: actions/cache/save@v4 + with: + path: | + ./* + key: '${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.itn.outputs.matrix_suffix}}' + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '020' + phase: install + job: install + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + # yamllint disable rule:line-length + cached_object: | + ${{ steps.iltp.outputs.install_cache_prepared_shop_prefix}}_${{steps.iltp.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}} + ${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.iltp.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}} + # yamllint enable rule:line-length + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + runscript: + needs: ['init', 'install'] + if: ${{ needs.init.outputs.runscript_matrix_script != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.runscript_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.runscript_matrix_mysql) }} + script: ${{ fromJSON(needs.init.outputs.runscript_matrix_script) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.runscript_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + steps: + - name: Load cached testplan + id: rstn + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: '' + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: rsltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.rstn.outputs.testplan}}' + set_output: true + set_print: true + set_env: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_runscript.log + token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Convert variables + id: rt + shell: bash + run: | + ${{ needs.init.outputs.debug }} + set +x + E=$(env|grep -e "^runscript_") + MATRIX_SCRIPT='${{ matrix.script }}' + if [[ ${MATRIX_SCRIPT} != *":"* ]]; then + echo -e "\033[0;31m ${X} does not contain a ':'. You need to specify scripts as ':'" + exit 1 + fi + IFS=':' read -r -a S <<< "${MATRIX_SCRIPT}" + PREFIX="${S[0]//-/_}" + SCRIPT="${S[1]}" + echo "runscript_script=${SCRIPT}"|tee -a "${GITHUB_OUTPUT}" + for KEY in docker_login load_shop \ + container_name container_options container_method \ + cache_bucket \ + composer_file composer_backup composer_transform composer_update composer_update_options composer_early \ + custom_script custom_script_container \ + path install_options \ + output_prefix coverage_prefix; do + VAR="runscript_${PREFIX}_${KEY}" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR="runscript_${KEY}" + fi + echo "runscript_${KEY}=${!VAR}" + cat >>"${GITHUB_OUTPUT}" <|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \ + tee -a "${GITHUB_OUTPUT}" + echo "runscript_title=${PREFIX}_${SCRIPT}"| \ + sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \ + sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' | \ + tee -a "${GITHUB_OUTPUT}" + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.rt.outputs.runscript_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.rt.outputs.runscript_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.rt.outputs.runscript_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + wait_for_selenium: true + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + # Also run this if there is a transformation but composer_early is set to 'skip' + if: ${{ steps.rt.outputs.runscript_composer_transform != '' && steps.rt.outputs.runscript_composer_early != 'true' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/${{ steps.rt.outputs.runscript_path }}/composer.json' + backup: true + transform: | + ${{ steps.rt.outputs.runscript_composer_transform }} + update: ${{ steps.rt.outputs.runscript_composer_update }} + update_options: '${{ steps.rt.outputs.runscript_composer_update_options }} -d /var/www/${{ steps.rt.outputs.runscript_path }}' + container_name: ${{ steps.rt.outputs.runscript_container_name }} + container_options: ${{ steps.rt.outputs.runscript_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run composer if there is no transform + # Only run this if there is no transformation and composer_early is set to 'false' + if: ${{ steps.rt.outputs.runscript_composer_transform == '' && steps.rt.outputs.runscript_composer_early == 'false' }} + run: | + # run composer + ${{ inputs.debug }} + docker compose exec -T \ + ${{ steps.rt.outputs.runscript_container_options }} \ + ${{ steps.rt.outputs.runscript_container_name }} \ + composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}" + docker compose exec -T \ + ${{ steps.rt.outputs.runscript_container_options }} \ + ${{ steps.rt.outputs.runscript_container_name }} \ + composer update --no-interaction -d "/var/www/${{ steps.rt.outputs.runscript_path }}" + + - name: Run custom scripts + if: ${{ steps.rt.outputs.runscript_custom_script != '' || steps.rt.outputs.runscript_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.rt.outputs.runscript_container_name }} + container_options: ${{ steps.rt.outputs.runscript_container_options }} + container_method: ${{ steps.rt.outputs.runscript_container_method }} + custom_script: ${{ steps.rt.outputs.runscript_custom_script }} + custom_script_container: ${{ steps.rt.outputs.runscript_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + token: ${{ github.token }} + + - name: 'Run runscript check' + uses: 'OXID-eSales/github-actions/run_test_script@v4' + 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 }} + container_options: ${{ steps.rt.outputs.runscript_container_options }} + container_method: ${{ steps.rt.outputs.runscript_container_method }} + output_artifact: ${{ steps.rt.outputs.runscript_output_prefix}}-${{steps.rt.outputs.runscript_suffix }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Upload coverage report + if: ${{ always() && steps.rt.outputs.runscript_coverage_prefix != '' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.rt.outputs.runscript_coverage_prefix}}-${{steps.rt.outputs.runscript_suffix }} + path: source/${{ steps.rt.outputs.runscript_path }}/tests/Reports/* + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '100' + phase: test + job: runscript + title: '${{ steps.rt.outputs.runscript_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + runslim: + needs: ['init', 'install'] + if: ${{ needs.init.outputs.runslim_matrix_script != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.runslim_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.runslim_matrix_mysql) }} + script: ${{ fromJSON(needs.init.outputs.runslim_matrix_script) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.runslim_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + steps: + - name: Load cached testplan + id: rstn + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: '' + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: rsltp + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.rstn.outputs.testplan}}' + set_output: true + set_print: true + set_env: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_runslim.log + token: ${{ secrets.enterprise_github_token }} + + - name: Convert variables + id: rt + shell: bash + run: | + ${{ needs.init.outputs.debug }} + set +x + E=$(env|grep -e "^runslim_") + MATRIX_SCRIPT='${{ matrix.script }}' + if [[ ${MATRIX_SCRIPT} != *":"* ]]; then + echo -e "\033[0;31m ${X} does not contain a ':'. You need to specify scripts as ':'" + exit 1 + fi + IFS=':' read -r -a S <<< "${MATRIX_SCRIPT}" + PREFIX="${S[0]//-/_}" + SCRIPT="${S[1]}" + echo "runslim_script=${SCRIPT}"|tee -a "${GITHUB_OUTPUT}" + for KEY in docker_login load_shop \ + container_name container_options container_method \ + cache_bucket \ + composer_file composer_backup composer_transform composer_update composer_update_options composer_early \ + custom_script custom_script_container \ + path install_options \ + output_prefix coverage_prefix; do + VAR="runslim_${PREFIX}_${KEY}" + if [[ "${E}" != *"${VAR}"* ]]; then + VAR="runslim_${KEY}" + fi + echo "runslim_${KEY}=${!VAR}" + cat >>"${GITHUB_OUTPUT}" <|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" + echo "runslim_title=${PREFIX}_${SCRIPT}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}" + + - name: 'Start shop' + uses: 'OXID-eSales/github-actions/start_shop@v4' + with: + cached_shop: '${{ steps.rt.outputs.runslim_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' + cache_bucket: ${{ steps.rt.outputs.runslim_cache_bucket }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + docker_login: ${{ steps.rt.outputs.runslim_docker_login }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + wait_for_selenium: true + debug: ${{ needs.init.outputs.debug }} + + - name: 'Modify composer.json' + if: ${{ steps.rt.outputs.runslim_composer_transform != '' && steps.rt.outputs.runslim_composer_early == 'false' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: 'source/${{ steps.rt.outputs.runslim_path }}/composer.json' + backup: true + transform: | + ${{ steps.rt.outputs.runslim_composer_transform }} + update: ${{ steps.rt.outputs.runslim_composer_update }} + update_options: '${{ steps.rt.outputs.runslim_composer_update_options }} -d /var/www/${{ steps.rt.outputs.runslim_path }}' + container_name: ${{ steps.rt.outputs.runslim_container_name }} + container_options: ${{ steps.rt.outputs.runslim_container_options }} + container_method: 'exec' + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Run composer if there is no transform + if: ${{ steps.rt.outputs.runslim_composer_transform == '' && steps.rt.outputs.runslim_composer_early == 'false' }} + run: | + # run composer + ${{ inputs.debug }} + docker compose exec -T \ + ${{ steps.rt.outputs.runslim_container_options }} \ + ${{ steps.rt.outputs.runslim_container_name }} \ + composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}" + docker compose exec -T \ + ${{ steps.rt.outputs.runslim_container_options }} \ + ${{ steps.rt.outputs.runslim_container_name }} \ + composer update --no-interaction -d "/var/www/${{ steps.rt.outputs.runslim_path }}" + + - name: Run custom scripts + if: ${{ steps.rt.outputs.runslim_custom_script != '' || steps.rt.outputs.runslim_custom_script_container != '' }} + uses: 'OXID-eSales/github-actions/run_custom_scripts@v4' + with: + container_name: ${{ steps.rt.outputs.runslim_container_name }} + container_options: ${{ steps.rt.outputs.runslim_container_options }} + container_method: ${{ steps.rt.outputs.runslim_container_method }} + custom_script: ${{ steps.rt.outputs.runslim_custom_script }} + custom_script_container: ${{ steps.rt.outputs.runslim_custom_script_container }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Run runslim check' + uses: 'OXID-eSales/github-actions/run_test_script@v4' + 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 }} + container_options: ${{ steps.rt.outputs.runslim_container_options }} + container_method: ${{ steps.rt.outputs.runslim_container_method }} + output_artifact: ${{ steps.rt.outputs.runslim_output_prefix}}-${{steps.rt.outputs.runslim_suffix }} + debug: ${{ needs.init.outputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Upload coverage report + if: ${{ always() && steps.rt.outputs.runslim_coverage_prefix != '' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.rt.outputs.runslim_coverage_prefix}}-${{steps.rt.outputs.runslim_suffix }} + path: source/${{ steps.rt.outputs.runslim_path }}/tests/Reports/* + + - name: 'Stop shop' + if: ${{ always() }} + uses: 'OXID-eSales/github-actions/stop_shop@v4' + with: + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '100' + phase: test + job: runslim + title: '${{ steps.rt.outputs.runslim_title }}' + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + sonarcloud: + needs: ['init', 'install', 'runscript', 'runslim'] + # yamllint disable-line rule:line-length + if: ${{ always() && needs.init.outputs.sonarcloud_matrix_testplan != '' && needs.init.outputs.sonarcloud_matrix_testplan != 'none' && needs.init.outputs.sonarcloud_matrix_testplan != 'skip' }} + strategy: + matrix: + php: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_php) }} + mysql: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_mysql) }} + testplan: ${{ fromJSON(needs.init.outputs.sonarcloud_matrix_testplan) }} + fail-fast: false + max-parallel: ${{ fromJSON(needs.init.outputs.sonarcloud_max_parallel) }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_MYSQL: ${{ matrix.mysql }} + MATRIX_TESTPLAN: ${{ matrix.testplan }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + steps: + - name: Warn if sonarcloud secret is missing + if: ${{ env.SONAR_TOKEN == '' }} + run: | + echo "::warning title=Missing secrets::Please set the repository secrets SONAR_TOKEN to run sonarcloud scans" + + - name: Load cached testplan + id: sonarcloud_testplan_name + if: ${{ env.SONAR_TOKEN != '' }} + uses: OXID-eSales/github-actions/load_cached_testplan@v4 + with: + php: ${{ matrix.php }} + mysql: ${{ matrix.mysql }} + prefix: '${{ needs.init.outputs.global_title }}' + root_testplan: ${{ needs.init.outputs.testplan }} + matrix_testplan: ${{ matrix.testplan }} + plan_folder: ${{ inputs.plan_folder }} + cache_name: ${{ needs.init.outputs.init_cache_name }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_bucket: ${{ needs.init.outputs.init_cache_bucket }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Load Testplan' + id: sonarcloud_testplan + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'joernott/load_testplan@v1' + with: + files: '${{steps.sonarcloud_testplan_name.outputs.testplan}}' + set_output: true + set_print: true + yaml: generated_testplan.yaml + loglevel: info + logfile: load_testplan_sonarcloud.log + token: ${{ secrets.enterprise_github_token }} + + - name: Checkout shop + if: ${{ env.SONAR_TOKEN != '' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_repository }}' + ref: '${{ steps.sonarcloud_testplan.outputs.sonarcloud_git_ref }}' + token: ${{ secrets.enterprise_github_token || github.token }} + + - name: Login to Docker Hub + env: + DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} + if: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_docker_login == 'true' && env.DOCKER_HUB_USER != '' }} + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: 'SonarCloud Scan' + if: ${{ env.SONAR_TOKEN != '' }} + uses: 'OXID-eSales/github-actions/sonarcloud@v4' + with: + coverage_artifact: 'coverage-reports-*-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' + output_artifact: 'coverage-reports-${{ needs.init.outputs.global_title }}' + target_branch: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_target_branch }} + strip_path: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_strip_path }} + github_ref_name: ${{ github.ref_name }} + sonarcloud_organization: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_organization }} + sonarcloud_project_key: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_key }} + sonarcloud_project_name: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_project_name }} + sonarcloud_parameters: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_parameters }} + sonar_token: ${{ secrets.SONAR_TOKEN }} + github_token: ${{ github.token }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + job: sonarcloud + title: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_title }} + php: ${{matrix.php}} + mysql: ${{matrix.mysql}} + testplan: ${{matrix.testplan}} + status: ${{job.status}} + debug: ${{ inputs.debug }} + github_token: ${{ secrets.enterprise_github_token || github.token }} + + yamllint: + needs: ['init', 'install'] + if: ${{ always() && needs.init.outputs.yamllint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Lint yaml files + id: yamllint + uses: OXID-eSales/github-actions/yamllint@v4 + with: + file_or_dir: ${{ needs.init.outputs.yamllint_file_or_dir }} + config_data: ${{ needs.init.outputs.yamllint_rules }} + debug: ${{ needs.init.outputs.debug }} + + - name: 'Write yamllint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '240' + phase: report + title: '' + job: 'yamllint' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + github_token: ${{ secrets.enterprise_github_token || github.token }} + + actionlint: + needs: ['init', 'install'] + if: ${{ always() && needs.init.outputs.actionlint_skip != 'true' }} + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Install npm on private runner + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + run: | + NPM=$(type -p 'npm'||true) + 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 python3-venv + fi + + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Run actionlint + id: actionlint + uses: raven-actions/actionlint@v2 + + - name: actionlint Summary + if: always() + run: | + echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}" + echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}" + echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code" + echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'" + echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors" + echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files" + echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}" + + - name: 'Write actionlint Report' + if: always() + uses: OXID-eSales/github-actions/append_report@v4 + with: + prefix: '${{ needs.init.outputs.global_title }}' + priority: '250' + phase: report + job: 'actionlint' + title: '' + php: '' + mysql: '' + testplan: '' + status: ${{job.status}} + debug: false + github_token: ${{ secrets.enterprise_github_token || github.token }} + + finish: + if: ${{ always() && needs.init.outputs.finish_skip != 'true' }} + needs: + - init + - install + - runscript + - runslim + - sonarcloud + - yamllint + - actionlint + runs-on: ${{ fromJSON(inputs.runs_on) }} + steps: + - name: Choose Slack channel + id: slack + shell: bash + run: | + if [ "${{ inputs.use_scheduled_slack_channel }}" == "false" ]; then + echo "webhook=${{ secrets.SLACK_WEBHOOK_URL }}" >>"${GITHUB_OUTPUT}" + else + echo "webhook=${{ secrets.SLACK_SCHEDULED_WEBHOOK_URL }}" >>"${GITHUB_OUTPUT}" + fi + - name: 'Generate report' + id: generate_report + uses: 'OXID-eSales/github-actions/generate_report@v4' + with: + prefix: '${{ needs.init.outputs.global_title }}' + slack_webhook: ${{ steps.slack.outputs.webhook }} + title: '${{ needs.init.outputs.finish_slack_title }}' + compact: '${{ needs.init.outputs.finish_slack_compact }}' + debug: ${{ inputs.debug }} + + - name: 'Checkout the repo for cleanup' + uses: actions/checkout@v4 + with: + path: repo + + - name: 'Clean Cache' + # if: ${{ steps.generate_report.outputs.overall_status == 'success' }} + uses: 'OXID-eSales/github-actions/clean_cache@v4' + env: + GH_TOKEN: ${{ github.token }} + with: + path: repo + runs_on: ${{ inputs.runs_on }} + cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} + cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }} + cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }} + cache_objects: | + ${{ steps.generate_report.outputs.cache_objects }} + debug: ${{ needs.init.outputs.debug }} diff --git a/append_report/action.yaml.backup b/append_report/action.yaml.backup new file mode 100644 index 00000000..2b150d40 --- /dev/null +++ b/append_report/action.yaml.backup @@ -0,0 +1,166 @@ +name: 'append_report' +description: 'Adds report and status snippets to the testplan artifact' +inputs: + prefix: + type: string + required: true + description: 'Prefix for the testplan artifact name' + header: + type: boolean + required: false + description: 'Do we need to write the phase header instead of a normal line' + default: false + priority: + type: string + required: false + description: 'Priority helps with sorting phases and table content by becoming part of the file names in the artifact' + default: '000' + phase: + type: string + required: true + description: 'Which phase are we in' + job: + type: string + required: false + description: 'Which job are we running' + default: '-' + title: + type: string + required: false + description: 'Title of the job' + default: 'default' + php: + type: string + required: false + description: 'PHP version for this matrix run' + default: '0' + mysql: + type: string + required: false + description: 'MySQL version for this matrix run' + default: '0' + testplan: + type: string + required: false + description: 'Testplan for this matrix run' + default: 'none' + status: + type: string + required: false + description: 'Testplan for this matrix run' + default: 'skipped' + cached_object: + type: string + required: false + description: 'Name of the cached_object for this step' + default: 'skipped' + debug: + type: boolean + description: 'Enable debugging' + default: false + required: false + github_token: + type: string + required: false + description: 'Github token to be replaced by a variable in the debug script' + default: '' + +runs: + using: "composite" + steps: + - name: 'Write Phase header' + if: ${{ inputs.header == 'true' }} + shell: bash + run: | + # append_report: Write Phase header + mkdir -p reports job_status slack_reports + cat <reports/${{inputs.priority}}-${{ inputs.phase }}_header.md + ## ${{ inputs.phase }} phase + |Job |Title|PHP|MySQL|Testplan|Status| + |:---|:----|--:|----:|:-------|:-----| + EOF + + - name: 'Write summary' + if: ${{ inputs.header == 'false' }} + shell: bash + run: | + # append_report: Write summary + REPORT_FILE='reports/${{inputs.priority}}-${{inputs.phase}}-${{inputs.job}}-${{inputs.title}}-PHP${{inputs.php}}_MYSQL${{inputs.mysql}}.md' + STATUS_FILE='job_status/${{inputs.priority}}-${{inputs.phase}}-${{inputs.job}}-${{inputs.title}}-PHP${{inputs.php}}_MYSQL${{inputs.mysql}}.txt' + CACHE_FILE='caches/${{inputs.priority}}-${{inputs.phase}}-${{inputs.job}}-${{inputs.title}}-PHP${{inputs.php}}_MYSQL${{inputs.mysql}}.txt' + PLAN_FILE='generated_testplan-${{inputs.priority}}-${{inputs.phase}}-${{inputs.job}}-${{inputs.title}}-PHP${{inputs.php}}_MYSQL${{inputs.mysql}}.yaml' + SKIPPED_ICON='![Skipped](https://a.slack-edge.com/production-standard-emoji-assets/14.0/google-medium/26aa.png)' + SUCCESS_ICON='![Success](https://a.slack-edge.com/production-standard-emoji-assets/14.0/google-medium/2705.png)' + CANCELLED_ICON='![Cancelled](https://a.slack-edge.com/production-standard-emoji-assets/14.0/google-large/26ab.png)' + FAILURE_ICON='![Failure](https://a.slack-edge.com/production-standard-emoji-assets/14.0/google-medium/274c.png)' + JOB_STATUS='${{inputs.status}}' + JOB_ICON="${JOB_STATUS^^}_ICON" + if [[ '${{inputs.testplan}}' =~ ^http.* ]]; then + BASE=$(echo '${{inputs.testplan}}'| sed -E 's|.+/(.*)$|\1|') + TP="[${BASE}](${{inputs.testplan}})" + else + TP="${{inputs.testplan}}" + fi + mkdir -p reports job_status caches + echo "|${{inputs.job}}|${{inputs.title}}|${{inputs.php}}|${{inputs.mysql}}|${TP}|${!JOB_ICON} ${JOB_STATUS}|" >"${REPORT_FILE}" + echo "${JOB_STATUS}" >"${STATUS_FILE}" + echo "${{inputs.cached_object}}" >"${CACHE_FILE}" + if [ -f 'generated_testplan.yaml' ]; then + mv generated_testplan.yaml "${PLAN_FILE}" + fi + + - name: Handle debug script + if: ${{ inputs.debug == 'true' }} + shell: bash + run: | + # append_report: Handle debug script + DEBUG_DIR="debug-PHP${{inputs.php}}_MYSQL${{inputs.mysql}}" + DEBUG_NAME="debug_${{inputs.priority}}_${{inputs.phase}}_${{inputs.job}}_${{inputs.title}}" + DEBUG_FILE="${DEBUG_DIR}/${DEBUG_NAME}.sh" + mkdir -p "${DEBUG_DIR}" + cat >"${DEBUG_FILE}" <>"${DEBUG_FILE}" + rm debug/debug.sh + fi + if [ -n "${{ inputs.github_token }}" ]; then + sed -e 's|${{ inputs.github_token}}|${DEBUG_GH_TOKEN}|g' -i.backup "${DEBUG_FILE}" + fi + cat >>"${DEBUG_FILE}" <>"${GITHUB_OUTPUT}" + + - name: Upload Artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: '${{ steps.safe_title.outputs.title }}' + path: | + load_testplan*.log + job_status/*.txt + reports/*.md + slack_reports/*.md + caches/*.txt + generated_testplan-*.yaml + debug-*/*.sh + if-no-files-found: ignore + retention-days: 1 diff --git a/begin_report/action.yaml.backup b/begin_report/action.yaml.backup new file mode 100644 index 00000000..12f0c485 --- /dev/null +++ b/begin_report/action.yaml.backup @@ -0,0 +1,185 @@ +name: 'begin_report' +description: 'Creates the initial markdown headers for the reports' +inputs: + prefix: + type: string + required: true + description: 'Prefix for the testplan artifact name' + repository: + type: string + required: true + description: 'URL of the github repository' + job: + type: string + required: false + description: 'URL of the job' + default: '-' + testplan: + type: string + required: false + description: 'URL/file name of the test plan' + default: '-' + title: + type: string + required: false + description: 'Title of the job' + default: 'default' + files: + type: string + required: false + description: 'Additional files to archive' + default: | + generated_testplan.yaml + generated_output.txt + generated_env.txt + load_testplan.log + debug: + type: boolean + description: 'Enable debugging' + default: false + required: false +outputs: + debug: + description: 'Debug scriptlet' + value: ${{ steps.debug.outputs.debug }} +runs: + using: "composite" + steps: + - name: 'Write Report header' + shell: bash + run: | + # begin_report: Write Report header + mkdir -p reports slack_reports + cat >reports/000-header.md <slack_reports/000-header.md <) ' >compact_slack_report.md + - name: Start debug script + id: debug + shell: bash + run: | + # begin_report: Start debug script + if [ '${{ inputs.debug }}' != 'true' ]; then + echo "debug=" >>"${GITHUB_OUTPUT}" + else + mkdir -p debug + cat >debug/000-start.sh <<'EODS' + #!/bin/bash + set -e + set -x + # Set this to your github token or export this variable before + # running the script + # DEBUG_GH_TOKEN='' + + function banner() { + PURPLE=$(echo -e "\033[0;35m") + NOCOLOR=$(echo -e "\033[0m") + cat <debug/999-end.sh <<'EODS' + # This runs the various job functions + init + EODS + + # Create debugging scriptlet + cat >>"${GITHUB_OUTPUT}" <<'EODS' + debug<>debug/debug.sh + sed -e 's|exit 1|#exit 1|' -e '/###BEGIN_DEBUG/,/###END_DEBUG/d' "$0" >>debug/debug.sh + ###END_DEBUG + debug_delimeter + EODS + fi + + - name: Debug debug + shell: bash + run: | + # begin_report: Debug debug + cat <<'EODD' + ${{ steps.debug.outputs.debug }} + EODD + + - name: 'Generate safe title' + id: safe_title + if: always() + shell: bash + run: | + # append_report: Generate safe title + TITLE=$( \ + echo 'testplan-${{inputs.prefix}}-000_header' \ + | sed -e 's#/|\s##g' \ + ) + echo "title=${TITLE}" >>"${GITHUB_OUTPUT}" + + - name: Upload Artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: 'testplan-${{inputs.prefix}}-000_header' + path: | + reports/000-header.md + slack_reports/000-header.md + debug/000-start.sh + debug/999-end.sh + compact_slack_report.md + ${{ inputs.files }} + if-no-files-found: ignore + retention-days: 1 diff --git a/build_docker/action.yaml.backup b/build_docker/action.yaml.backup new file mode 100644 index 00000000..27576d3a --- /dev/null +++ b/build_docker/action.yaml.backup @@ -0,0 +1,57 @@ +name: 'login into dockerhub and build docker images' +description: 'build and push docker images' +inputs: + dockerhub_username: + type: string + required: true + description: 'username to login into dockerhub' + dockerhub_password: + type: string + required: true + description: 'password to login into dockerhub' + image_name: + type: string + required: true + description: 'name of the image' + tags: + type: string + required: false + description: 'version of the image' + build-args: + type: string + required: false + description: 'matrix versions and dependencies' + platforms: + type: string + required: true + description: 'describe the platforms to be used' + debug: + type: boolean + description: 'Enable debugging' + default: false + required: false + +runs: + using: "composite" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log into Docker Hub + if: ${{ github.event_name != 'pull_request' && inputs.dockerhub_username != '' }} + uses: docker/login-action@v3 + with: + username: ${{ inputs.dockerhub_username }} + password: ${{ inputs.dockerhub_password }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ${{ inputs.image_name }} + file: ${{ inputs.image_name }}/Dockerfile + platforms: ${{ inputs.platforms }} + push: ${{ github.event_name != 'pull_request' && inputs.dockerhub_username != '' }} + tags: ${{ inputs.tags }} + build-args: ${{ inputs.build-args }} diff --git a/clean_cache/action.yaml.backup b/clean_cache/action.yaml.backup new file mode 100644 index 00000000..f7ee0b20 --- /dev/null +++ b/clean_cache/action.yaml.backup @@ -0,0 +1,101 @@ +name: 'clean_cache' +description: 'clean the cache' +inputs: + cache_endpoint: + type: string + required: true + description: 'secrets.CACHE_ENDPOINT for actions-cache' + cache_access_key: + type: string + required: true + description: 'secrets.CACHE_ACCESS_KEY for actions-cache' + cache_secret_key: + type: string + required: true + description: 'secrets.CACHE_SECRET_KEY for actions-cache' + cache_objects: + type: string + required: true + description: 'objects to delete for cleanup' + runs_on: + type: string + required: true + description: 'Runner for this workflow' + path: + type: string + required: true + description: 'Path in which the current project is checked out' + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + +runs: + using: composite + steps: + - name: Install s3cmd and gh + shell: bash + run: | + # clean_cache: Install s3cmd and gh + GH=$(type -p 'gh'||true) + if [ -z "${GH}" ]; then + echo -e "\033[0;35m### Installing gh ###\033[0m" + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg + ARCH=$(dpkg --print-architecture) + echo "deb [arch=${ARCH} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" |\ + sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update + sudo apt-get -qq install gh + GH=$(type -p 'gh'||true) + fi + ${GH} extension install actions/gh-actions-cache + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install s3cmd + if [[ '${{ inputs.runs_on }}' != *"ubuntu"* ]]; then + cat >/home/runner/.s3cfg <&1 | tee ${{ inputs.logfile }} || true + + - name: Upload Codeception Artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: | + ${{ inputs.logfile }} + ${{ inputs.output_files }} + ${{ inputs.coverage_path }} + if-no-files-found: ignore + retention-days: 4 + + - name: Upload Coverage Report + if: ${{ always() && inputs.coverage_path != '' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.coverage_artifact }} + path: ${{ inputs.coverage_path }} + if-no-files-found: ignore + retention-days: 4 + + - name: Output php error log + if: always() + shell: bash + run: | + # codeception: Output php error log + ${{ inputs.debug }} + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + + - name: Check results + shell: bash + run: | + # codeception: Check results + ${{ inputs.debug }} + PURPLE=$(echo -e "\033[0;31m") + NOCOLOR=$(echo -e "\033[0m") + if [ ! -s "${{ inputs.logfile }}" ]; then + cat <failure_pattern.tmp < .composer_merge.tmp.json <<'EOF' + ${{ inputs.transform }} + EOF + echo -e "\033[0;35m### JSON to merge\033[0m" + cat .composer_merge.tmp.json + + - name: Merge files + uses: 'joernott/load_testplan@v1' + with: + files: '${{ inputs.file }},.composer_merge.tmp.json' + input_type: 'json' + json: '${{ inputs.file }}' + - name: Debug merge + if: ${{ inputs.debug != '' }} + shell: bash + run: | + cat >>debug/debug.sh <'${{ inputs.file }}' <<'EOF' + EODS + # We need this because of the escapes inside composer.json + cat '${{ inputs.file }}' >>debug/debug.sh + echo -e "\nEOF" >>debug/debug.sh + + - name: Cleanup + shell: bash + run: | + # composer_merge: Cleanup + ${{ inputs.debug }} + rm .composer_merge.tmp.json + cat '${{ inputs.file }}' + if [ '${{ inputs.update }}' == 'true' ]; then + echo -e "\033[0;35m### Running composer update with ${{ inputs.update_options }}\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + composer update ${{ inputs.update_options }} + fi diff --git a/consolidate_artifacts/action.yaml.backup b/consolidate_artifacts/action.yaml.backup new file mode 100644 index 00000000..4c4567e5 --- /dev/null +++ b/consolidate_artifacts/action.yaml.backup @@ -0,0 +1,53 @@ +name: 'consolidate_artifacts' +description: 'Consolidate multiple artifacts into one' +inputs: + target: + type: string + required: true + description: 'Name of the target artifact' + pattern: + type: string + required: true + description: 'Pattern for the artifact names to consolidate' + path: + type: string + required: false + description: 'Path to extract to' + default: './' + +runs: + using: "composite" + steps: + - name: Check if previous consolidated artifact exists + id: check_consolidated + uses: LIT-Protocol/artifact-exists-action@v0 + with: + name: '${{ inputs.target }}' + + - name: 'Download consolidated artifact' + if: ${{ steps.check_consolidated.outputs.exists == 'true' }} + uses: actions/download-artifact@v4 + with: + name: '${{ inputs.target }}' + path: ${{ inputs.path }} + + - name: 'Download artifacts' + uses: actions/download-artifact@v4 + with: + pattern: '${{ inputs.pattern }}' + merge-multiple: true + path: ${{ inputs.path }} + + - name: 'Delete old consolidated artifact' + if: ${{ steps.check_consolidated.outputs.exists == 'true' }} + uses: joernott/rm-artifact@v1 + with: + name: '${{ inputs.target }}' + + - name: Upload consolidated artifact + uses: actions/upload-artifact@v4 + with: + name: '${{ inputs.target }}' + path: ${{ inputs.path }} + retention-days: 4 + overwrite: true diff --git a/generate_report/action.yaml.backup b/generate_report/action.yaml.backup new file mode 100644 index 00000000..098fc5a7 --- /dev/null +++ b/generate_report/action.yaml.backup @@ -0,0 +1,230 @@ +name: 'generate_report' +description: 'Appends data to the job_status' +inputs: + prefix: + type: string + required: true + description: 'Prefix for the testplan artifact name' + slack_webhook: + type: string + required: true + description: 'URL for the channel web hook, see https://api.slack.com/apps/A04CAPK58G0/incoming-webhooks?' + title: + type: string + required: false + description: 'Title of the job' + default: 'default' + compact: + type: boolean + required: false + description: 'Generate compact slack message' + default: false + debug: + type: boolean + description: 'Enable debugging' + default: false + required: false +outputs: + overall_status: + description: 'Overall status of the tests' + value: ${{ steps.process_slack.outputs.overall_status_plain }} + cache_objects: + description: 'List of cached objects collected by append_report' + value: ${{ steps.cache_list.outputs.cache_objects }} + +runs: + using: "composite" + steps: + - name: 'Consolidate testplan artifacts' + uses: 'OXID-eSales/github-actions/consolidate_artifacts@v4' + with: + target: 'testplan-${{inputs.prefix}}' + pattern: 'testplan-${{inputs.prefix}}-*' + + - name: 'Process job results for slack' + id: process_slack + shell: bash + run: | + # generate_report: Process job results for slack + COMPACT_FILE="compact_slack_report.md" + SKIPPED_EMOJI=':white_circle:' + SUCCESS_EMOJI=':white_check_mark:' + CANCELLED_EMOJI=':black_circle:' + FAILURE_EMOJI=':x:' + STATUS=(skipped success cancelled failure) + CUMULATED=0 + OVERALL=0 + LAST_GROUP='' + TEST_FILES=$(find job_status/ -type f -iname "*.txt"|sort) + mkdir -p slack_reports compact_slack_reports + for FILE in ${TEST_FILES}; do + F=$(echo "${FILE}" | sed -e 's|^.*job_status/||' -e 's|\.txt$ ||') + IFS='-' read -r -a PARTS <<< "${F}" + PRIORITY="${PARTS[0]}" + PHASE="${PARTS[1]}" + JOB="${PARTS[2]}" + TITLE="${PARTS[3]}" + MATRIX="${PARTS[4]}" + if [ "${PRIORITY}-${PHASE}-${JOB}-${TITLE}" != "${LAST_GROUP}" ]; then + if [ -n "${LAST_GROUP}" ]; then + SLACK_FILE="slack_reports/${LAST_GROUP}.md" + SUMMARY_STATUS="${STATUS[CUMULATED]}" + SUMMARY_EMOJI="${SUMMARY_STATUS^^}_EMOJI" + echo -ne " :arrow_right: *${SUMMARY_STATUS}* ${!SUMMARY_EMOJI}\n" >>"${SLACK_FILE}" + CUMULATED=0 + fi + LAST_GROUP="${PRIORITY}-${PHASE}-${JOB}-${TITLE}" + fi + VALUE=$(head -n 1 "${FILE}") + case ${VALUE} in + skipped) SNUM=0 ;; + success) SNUM=1 ;; + cancelled) SNUM=2 ;; + *) SNUM=3 ;; + esac + if [ ${SNUM} -gt ${CUMULATED} ]; then + CUMULATED=$SNUM + fi + if [ ${SNUM} -gt ${OVERALL} ]; then + OVERALL=$SNUM + fi + JOB_EMOJI="${VALUE^^}_EMOJI" + SLACK_FILE="slack_reports/${LAST_GROUP}.md" + if [ ! -f "${SLACK_FILE}" ]; then + echo -n "- ${PHASE}/${JOB}: ${TITLE} " >"${SLACK_FILE}" + fi + echo -n "${!JOB_EMOJI} " >>"${SLACK_FILE}" + echo -n "${!JOB_EMOJI}" >>"${COMPACT_FILE}" + + done + SLACK_FILE="slack_reports/${PRIORITY}-${PHASE}-${JOB}.md" + SUMMARY_STATUS="${STATUS[CUMULATED]}" + SUMMARY_EMOJI="${SUMMARY_STATUS^^}_EMOJI" + echo -ne " :arrow_right: *${SUMMARY_STATUS}* ${!SUMMARY_EMOJI}\n" >>"${SLACK_FILE}" + OVERALL_STATUS="${STATUS[OVERALL]}" + OVERALL_EMOJI="${OVERALL_STATUS^^}_EMOJI" + echo "overall_status=${!OVERALL_EMOJI} ${OVERALL_STATUS}" >>"${GITHUB_OUTPUT}" + echo "overall_status_plain=${OVERALL_STATUS}" >>"${GITHUB_OUTPUT}" + + - name: 'Output reports' + shell: bash + run: | + # generate_report: Output reports + for FILE in $(find reports -type f|sort); do + cat "${FILE}" >>github_report.md + done + cat github_report.md >>"${GITHUB_STEP_SUMMARY}" + + GROUPLIST="" + for FILE in $(find slack_reports -type f|sort); do + GROUP=$(echo "${FILE}"|sed -e 's|\..*$||'|awk -F '-' '{print $2}') + if [[ "${GROUPLIST}" != *"${GROUP}"* ]]; then + GROUPLIST="${GROUPLIST} ${GROUP}" + fi + cat "${FILE}" >>"slack_report-${GROUP}.md" + done + TITLE='${{inputs.title}} ${{ steps.process_slack.outputs.overall_status}}' + if [ '${{ inputs.compact }}' == 'false' ]; then + cat >slack.json <>slack.json <>slack.json <>compact_slack_report.md + MARKDOWN=$(cat "compact_slack_report.md" | tr -d '\n') + cat >slack.json <>"${SCRIPT}.sh" + echo "${JOBNAME}" >>"${SCRIPT}.end" + done + cat "${SCRIPT}.end" >>"${SCRIPT}.sh" + rm "${SCRIPT}.end" + chmod 0755 "${SCRIPT}.sh" + done + + - name: Send custom JSON data to Slack workflow + if: ${{ inputs.slack_webhook != '' }} + uses: slackapi/slack-github-action@v1 + with: + payload-file-path: 'slack.json' + env: + SLACK_WEBHOOK_URL: ${{ inputs.slack_webhook }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + + - name: 'Update testplan artifacts' + uses: 'OXID-eSales/github-actions/consolidate_artifacts@v4' + with: + target: 'testplan-${{inputs.prefix}}' + pattern: 'testplan-${{inputs.prefix}}-*' diff --git a/install_module/action.yaml.backup b/install_module/action.yaml.backup new file mode 100644 index 00000000..d82ebb5f --- /dev/null +++ b/install_module/action.yaml.backup @@ -0,0 +1,203 @@ +name: 'install_module' +description: 'Fetches the module and installs it' +inputs: + container_name: + type: string + required: false + description: 'Name of the container to run the test in' + default: 'php' + container_options: + type: string + required: false + description: 'Additional options to pass into the container' + default: '' + container_method: + type: string + required: false + description: 'Method to execute the commands inside a container, either "run" or "exec"' + default: 'exec' + package_name: + type: string + required: true + description: 'Name of the module package' + module_ids: + type: string + required: true + description: 'Ids of the module' + module_path: + type: string + required: false + description: 'Path for the checkout and url' + default: 'dev-packages/test-module' + activate: + type: string + required: true + description: 'Space/multiline list of modules to activate' + git_module_url: + type: string + required: true + description: 'URL for the module repository' + git_module_ref: + type: string + required: false + description: 'Branch, tag or hash of the commit to check out' + default: true + update: + type: boolean + required: false + description: 'Run composer update and reset database after instlling the module' + default: true + output_files: + type: string + required: false + description: 'Output files of the codeception run to put into the output artifact' + default: | + docker-compose.yml + source/composer.json + source/composer.lock + source/source/config.inc.php + output_artifact: + type: string + required: false + description: 'Github run artifact to put the output files in' + default: 'install_module-artifacts' + enterprise_github_token: + type: string + required: false + description: 'OAuth token to access enterprise repos' + default: '' + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + +runs: + using: "composite" + steps: + - name: Locate Console + shell: bash + run: | + # install_module: Locate Console + cd source + if [ -f 'bin/oe-console' ]; then + OE_CONSOLE='bin/oe-console' + else + if [ -f 'vendor/bin/oe-console' ]; then + OE_CONSOLE='vendor/bin/oe-console' + else + echo -e "\033[0;31mCan't find oe-console in bin or vendor/bin!\033[0m" + exit 1 + fi + fi + echo "OE_CONSOLE=${OE_CONSOLE}"|tee -a "${GITHUB_ENV}" + + + - name: Configure enterprise credentials + shell: bash + run: | + # install_module: Configure enterprise credentials + ${{ inputs.debug }} + if [ -n "${{ inputs.enterprise_github_token }}" ]; then + echo -e "\033[0;35m### configure github access ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + composer config github-protocols https + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + composer config -g github-oauth.github.com "${{ inputs.enterprise_github_token }}" + fi + + - name: 'Modify composer.json' + uses: 'OXID-eSales/github-actions/composer_merge@v4alpha' + with: + file: 'source/composer.json' + backup: true + transform: | + { + "require": { + "${{ inputs.package_name }}": "dev-${{ inputs.git_module_ref }}" + }, + "repositories": { + "${{ inputs.package_name }}": { + "type": "path", + "url": "./${{inputs.module_path}}", + "options": { + "symlink": true + } + } + } + } + update: ${{ inputs.update }} + container_name: ${{ inputs.container_name }} + container_options: ${{ inputs.container_options }} + container_method: 'exec' + debug: ${{ inputs.debug }} + + - name: Install dependencies and reset database + if: ${{ inputs.update == 'true' }} + shell: bash + run: | + # install_module: Install dependencies and reset database + ${{ inputs.debug }} + # docker compose ${{ inputs.container_method }} -T \ + # ${{ inputs. container_options }} \ + # ${{ inputs.container_name}} \ + # composer update --no-interaction + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs. container_options }} \ + ${{ inputs.container_name}} \ + ${{ env.OE_CONSOLE }} oe:database:reset \ + --db-host=mysql --db-port=3306 --db-name=example --db-user=root --db-password=root --force + + - name: Activate modules + shell: bash + run: | + # install_module: Activate modules + ${{ inputs.debug }} + MODULES=$(echo -n "${{ inputs.activate }}"| tr '\n' ' ') + for MODULE in ${MODULES}; do + echo -e "\033[0;35m### activating module ${MODULE} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + ${{ env.OE_CONSOLE }} oe:module:activate "${MODULE}" + done + + - name: Install module dependencies + shell: bash + run: | + # install_module: Install module dependencies + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs. container_options }} \ + --workdir=/var/www \ + ${{ inputs.container_name}} \ + composer install + + - name: Write files list + if: always() + shell: bash + run: | + # install_module: Write files list + find . >files.txt + + - name: Output php error log + if: always() + shell: bash + run: | + # install_module: Output php error log + ${{ inputs.debug }} + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + + - name: Upload configuration artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: ${{ inputs.output_files }} diff --git a/install_shop/action.yaml.backup b/install_shop/action.yaml.backup new file mode 100644 index 00000000..45e20e32 --- /dev/null +++ b/install_shop/action.yaml.backup @@ -0,0 +1,103 @@ +name: 'install_shop' +description: 'Fetches the prepared shop from cache and installs it' +inputs: + container_name: + type: string + required: false + description: 'Name of the container to run the test in' + default: 'php' + container_options: + type: string + required: false + description: 'Additional options to pass into the container' + default: '' + container_method: + type: string + required: false + description: 'Method to execute the commands inside a container, either "run" or "exec"' + default: 'exec' + is_enterprise: + type: boolean + required: false + default: false + config_idebug: + type: boolean + required: false + default: false + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false +runs: + using: "composite" + steps: + - name: Locate Console + shell: bash + run: | + # install_shop: Locate Console + cd source + if [ -f 'bin/oe-console' ]; then + OE_CONSOLE='bin/oe-console' + else + if [ -f 'vendor/bin/oe-console' ]; then + OE_CONSOLE='vendor/bin/oe-console' + else + echo -e "\033[0;31mCan't find oe-console in bin or vendor/bin!\033[0m" + exit 1 + fi + fi + echo "OE_CONSOLE=${OE_CONSOLE}"|tee -a "${GITHUB_ENV}" + + - name: Run Install Shop + shell: bash + run: | + # install_shop: Run Install Shop + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + ${{ env.OE_CONSOLE }} oe:setup:shop \ + --db-host mysql \ + --db-port 3306 \ + --db-name example \ + --db-user root \ + --db-password root \ + --shop-url http://localhost.local/ \ + --shop-directory /var/www/source \ + --compile-directory /var/www/source/tmp + + - name: Activate iDebug + if: ${{ inputs.config_idebug == 'true' }} + shell: bash + run: | + # install_shop: Activate iDebug + ${{ inputs.debug }} + if [ -f source/source/config.inc.php ]; then + perl -pi -e 's#iDebug = 0;#iDebug = -1;#g;' source/source/config.inc.php + fi + if [ -f source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php ]; then + perl -pi -e 's#iDebug = 0;#iDebug = -1;#g;' source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php + fi + + - name: Activate theme + if: ${{ inputs.is_enterprise == 'true' }} + shell: bash + run: | + # install_shop: Activate theme + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + ${{ env.OE_CONSOLE }} oe:theme:activate apex + + - name: Output php error log + if: always() + shell: bash + run: | + # install_shop: Output php error log + ${{ inputs.debug }} + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi diff --git a/load_cached_testplan/action.yaml.backup b/load_cached_testplan/action.yaml.backup new file mode 100644 index 00000000..0465593f --- /dev/null +++ b/load_cached_testplan/action.yaml.backup @@ -0,0 +1,106 @@ +name: 'load_cached_testplan' +description: 'Fetches the testplan and sets environment variables for it' +inputs: + php: + type: string + required: false + description: 'Version of PHP for this instance' + default: '8.2' + mysql: + type: string + required: false + description: 'Version of MySQL for this instance' + default: '8.0' + prefix: + type: string + required: true + description: 'Prefix for the testplan artifact name' + root_testplan: + type: string + required: true + description: 'Base testplan list' + matrix_testplan: + type: string + required: true + description: 'Current matrix test plans to add' + plan_folder: + type: string + required: true + description: 'Name of the cached testplan object' + cache_name: + type: string + required: true + description: 'Name of the cached testplan object' + cache_bucket: + type: string + required: false + description: 'Name of the local s3 cache bucket' + default: 'oxideshop-ee' + cache_endpoint: + type: string + required: false + description: 'secrets.CACHE_ENDPOINT for actions-cache' + default: '' + cache_access_key: + type: string + required: false + description: 'secrets.CACHE_ACCESS_KEY for actions-cache' + default: '' + cache_secret_key: + type: string + required: false + description: 'secrets.CACHE_SECRET_KEY for actions-cache' + default: '' + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false +outputs: + # workflow variables + testplan: + description: 'Final testplan list' + value: ${{ steps.testplan_name.outputs.testplan }} + matrix_suffix: + description: 'Suffix for this matrix run, consisting of php and mysql version' + value: ${{ steps.testplan_name.outputs.matrix_suffix }} + +runs: + using: "composite" + steps: + - name: Load cached testplan + id: load_testplan_cache + uses: tespkg/actions-cache/restore@v1 + with: + path: | + ${{ inputs.plan_folder}}/* + key: ${{ inputs.cache_name }} + restore-keys: ${{ inputs.cache_name }} + endpoint: ${{ inputs.cache_endpoint }} + accessKey: ${{ inputs.cache_access_key }} + secretKey: ${{ inputs.cache_secret_key }} + bucket: ${{ inputs.cache_bucket }} + + - name: Confirm successful restore + shell: bash + run: | + # load_cached_testplan: Confirm successful restore + if [ "${{ steps.load_testplan_cache.outputs.cache-hit }}" != "true" ]; then + echo -e "\033[0;31m### Failed to load ${{ inputs.cache_name }} from cache\033[0m" + exit 1 + fi + + - name: 'Get testplan name' + id: testplan_name + shell: bash + run: | + # load_cached_testplan: Get testplan name + DEFAULT_TESTPLAN=$(echo '${{ inputs.root_testplan }}'|sed -e 's|,${{ inputs.plan_folder }}/defaults/_rename.yaml||') + MATRIX_TESTPLAN=$(echo "${{ inputs.matrix_testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g') + # ToDo: Remove the ,${{ inputs.plan_folder }}/defaults/_rename.yaml when releasing v5 + if [[ '${{ inputs.matrix_testplan}}' == '-' || -z '${{ inputs.matrix_testplan}}' ]]; then + echo "testplan=${{ inputs.root_testplan }}" | tee -a "${GITHUB_OUTPUT}" + else + echo "testplan=${DEFAULT_TESTPLAN},${MATRIX_TESTPLAN},${{ inputs.plan_folder }}/defaults/_rename.yaml" | tee -a "${GITHUB_OUTPUT}" + fi + echo "matrix_suffix=${{inputs.prefix}}-PHP${{inputs.php}}-MYSQL${{inputs.mysql}}" | tee -a "${GITHUB_OUTPUT}" diff --git a/phpcs/action.yaml.backup b/phpcs/action.yaml.backup new file mode 100644 index 00000000..19b2cbaf --- /dev/null +++ b/phpcs/action.yaml.backup @@ -0,0 +1,184 @@ +name: 'phpcs' +description: 'Executes phpcs tests in a running container and uploads the logs as artefacts' +inputs: + container_name: + type: string + required: false + description: 'Name of the container to run the test in' + default: 'php' + container_options: + type: string + required: false + description: 'Additional options to pass into the container' + default: '' + container_method: + type: string + required: false + description: 'Method to execute the commands inside a container, either "run" or "exec"' + default: 'exec' + diff_only: + type: boolean + required: false + description: 'Run phpcs only on changed files between this and the last commit' + default: true + git_ref: + type: string + required: false + description: 'Reference to check out' + default: 'main' + filter: + type: string + required: false + description: 'Filter the file names against this regex' + default: '\.php$' + additional_options: + type: string + required: false + description: 'Optional: Additional options to pass to phpcs' + default: '-q --standard=PSR12' + logfile: + type: string + required: false + description: 'Name of the output logfile' + default: 'phpcs_log.txt' + output_artifact: + type: string + required: false + description: 'Github run artifact to put the logfile in' + default: 'phpcs-log' + output_files: + type: string + required: false + description: 'Github run artifact to put the logfile and ph0p error log in' + default: | + data/php/logs/error_log.txt + failure_pattern: + type: string + required: false + description: 'Grep pattern which indicate that the test failed' + default: 'fail|\\.\\=\\=|Warning|Notice|Deprecated|Fatal|Error' + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + +runs: + using: "composite" + steps: + - name: 'List changed files' + id: diff + shell: bash + run: | + # phpcs: List changed files + ${{ inputs.debug }} + cd source + if [ "${{ inputs.diff_only }}" == "true" ]; then + echo -e "\033[0;35m### Use git diff for phpcs using filter '${{ inputs.filter }}' ###\033[0m" + git diff --name-only --diff-filter=AM ${{ inputs.git_ref }} HEAD~1 | grep '${{ inputs.filter }}' | while read file; do + if [[ -f "$file" ]]; then + echo "$file" + fi + done >changed-files.txt || true + else + echo -e "\033[0;35m### Use full file list for phpcs using filter '${{ inputs.filter }}' ###\033[0m" + find . -type f | grep '${{ inputs.filter }}' >changed-files.txt || true + fi + if [[ -f "changed-files.txt" && -s "changed-files.txt" ]]; then + echo "skip=false" | tee -a "$GITHUB_OUTPUT" + cat changed-files.txt + FILES="" + for FILE in $(cat changed-files.txt); do + FILES="${FILES} ${FILE}" + done + echo "files=${FILES}" | tee -a "${GITHUB_OUTPUT}" + else + echo "skip=true" | tee -a "$GITHUB_OUTPUT" + fi + cd .. + + - name: Run PHP_CS check + shell: bash + if: ${{ steps.diff.outputs.skip == 'false' }} + run: | + # phpcs: Run PHP_CS check + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + php vendor/bin/phpcs --version \ + | tee "${{ inputs.logfile }}" 2>&1 || true + docker compose ${{ inputs.container_method }} -T ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + php vendor/bin/phpcs \ + ${{ inputs.additional_options }} \ + ${{ steps.diff.outputs.files }} \ + | tee "${{ inputs.logfile }}" 2>&1 || true + + - name: Upload Artifact + if: ${{ always() && steps.diff.outputs.skip == 'false' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: | + ${{ inputs.logfile }} + ${{ inputs.output_files }} + if-no-files-found: error + retention-days: 4 + + - name: Output php error log + if: always() + shell: bash + run: | + # phpcs: Output php error log + ${{ inputs.debug }} + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + + - name: Check results + shell: bash + run: | + # phpcs: Check results + ${{ inputs.debug }} + PURPLE=$(echo -e "\033[0;31m") + NOCOLOR=$(echo -e "\033[0m") + if [ '${{steps.diff.outputs.skip}}' == 'true' ]; then + cat <failure_pattern.tmp <"${GITHUB_OUTPUT}" + set -e + + if [ '${{ inputs.generate_baseline }}' == 'true' ]; then + echo -e "\033[0;35m### Generate phpmd baseline for ${{ inputs.source_path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + vendor/bin/phpmd /var/www/${{ inputs.source_path }} json /var/www/${{ inputs.config }} \ + ${{ inputs.additional_options }} \ + --generate-baseline --baseline-file '/var/www/${{ inputs.report_path }}/phpmd.baseline.xml' || true + fi + + if [ '${{inputs.verbose}}' == 'true' ]; then + echo -e "\033[0;35m### Run phpmd in ${{ inputs.source_path }} ###\033[0m" + set +e + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + vendor/bin/phpmd /var/www/${{ inputs.source_path }} ansi /var/www/${{ inputs.config }} \ + ${{ inputs.additional_options }} \ + | tee -a source/${{inputs.report_path}}/phpmd-${{ inputs.title }}.txt || true + set -e + fi + + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt | tee -a ${{inputs.report_path}}/php_error_log-${{ inputs.title }}.txt + fi + + - name: Upload artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: | + source/${{ inputs.report_path }}* + + - name: Check results + shell: bash + run: | + # phpmd: Check results + ${{ inputs.debug }} + FILE='source/${{inputs.report_path }}/phpmd-${{ inputs.title }}.json' + RESULT=0 + if [ ${{ steps.phpmd.outputs.result }} -eq 0 ]; then + echo -e "\033[0;32m phpmd exited with error code 0" + else + echo -e "\033[0;31m phpmd exited with error code ${{ steps.phpmd.outputs.result }}" + RESULT=1 + if [ ! -s "${FILE}" ]; then + echo -e "\033[0;31m ${FILE} is empty!" + fi + fi + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;31m php error log is not empty!" + RESULT=1 + fi + cat >failure_pattern.tmp <source/${{inputs.report_path }}/phpstan-${{ inputs.title }}.json || true + echo "result=$?" >"${GITHUB_OUTPUT}" + set -e + if [ '${{ inputs.generate_baseline }}' == 'true' ]; then + echo -e "\033[0;35m### Generate phpstan baseline for ${{ inputs.source_path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + /var/www/vendor/bin/phpstan \ + -c/var/www/${{inputs.neon_file}} analyse /var/www/${{ inputs.source_path }} \ + --generate-baseline /var/www/${{inputs.report_path }}/phpstan-${{ inputs.title }}-baseline.neon \ + ${{inputs.additional_options}} --quiet \ + || true + fi + + if [ '${{inputs.verbose}}' == 'true' ]; then + echo -e "\033[0;35m### Run phpstan in ${{ inputs.source_path }} ###\033[0m" + set +e + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + /var/www/vendor/bin/phpstan \ + -c/var/www/${{inputs.neon_file}} analyse /var/www/${{ inputs.source_path }} \ + ${{inputs.additional_options}} \ + | tee -a source/${{inputs.report_path}}/phpstan-${{ inputs.title }}.txt || true + set -e + fi + + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt | tee -a ${{inputs.report_path}}/php_error_log-${{ inputs.title }}.txt + fi + + - name: Upload artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: | + source/${{ inputs.report_path }}* + + - name: Check results + shell: bash + run: | + # phpstan: Check results + ${{ inputs.debug }} + FILE='source/${{inputs.report_path }}/phpstan-${{ inputs.title }}.json' + RESULT=0 + if [ ${{ steps.phpstan.outputs.result }} -eq 0 ]; then + echo -e "\033[0;32m phpstan exited with error code 0" + if [ ! -s "${FILE}" ]; then + echo -e "\033[0;32m ${FILE} is empty." + else + echo -e "\033[0;31m ${FILE} is not empty, please check!" + RESULT=1 + fi + else + echo -e "\033[0;31m phpstan exited with error code ${{ steps.phpmd.outputs.result }}" + RESULT=1 + if [ ! -s "${FILE}" ]; then + echo -e "\033[0;31m ${FILE} is empty!" + fi + fi + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;31m php error log is not empty!" + RESULT=1 + fi + cat >failure_pattern.tmp <failure_pattern.tmp <>"${GITHUB_OUTPUT}" + cat >>debug/debug.sh <<'EODS' + banner "Checkout module" + # Note: we use ssh here, the workflow uses https and the runtime token or enterprise token + echo -e "\033[0;35mHandling the pull request for the EE shop\033[0m" + git clone --depth 2 \ + git@github.com:OXID-eSales/oxideshop_ee.git \ + --branch ${{ inputs.github_base_ref }} \ + --single-branch 'source/dev-packages/oxideshop_ee' + git -C 'source/dev-packages/oxideshop_ee' fetch origin \ + refs/pull/${{ github.event.number }}/head:pr_${{ github.event.number }} + git -C 'source/dev-packages/oxideshop_ee' checkout pr_${{ github.event.number }} + EODS + + - name: Prepare container configuration + shell: bash + run: | + # prepare_shop: Prepare container configuration + ${{ inputs.debug }} + # Deprecated in v5: The mkdir is no longer needed + mkdir -p source/dev-packages + make setup + make addbasicservices + + if [ -n "${{ inputs.add_services }}" ]; then + for SERVICE in ${{ inputs.add_services }}; do + echo -e "\033[0;35mAdding service ${SERVICE}\033[0m" + if [ "${SERVICE}" == "nginx-rp" ]; then + perl -pi\ + -e 's#- 80:80#- 8000:80#g;'\ + -e 's#apache:localhost.local#nginx:localhost.local#g;'\ + docker-compose.yml + fi + make file=services/${SERVICE}.yml addservice + done + fi + perl -pi\ + -e "s#PHP_VERSION=.*#PHP_VERSION='${{ inputs.php }}'#g;"\ + -e "s#MYSQL_VERSION=.*#MYSQL_VERSION='${{ inputs.mysql }}'#g;"\ + .env + perl -pi\ + -e 's#display_errors =.*#display_errors = false#g;'\ + -e 'print "${{ inputs.custom_ini_xdebug }}\n\n";'\ + -e 'print "error_reporting = ${{ inputs.custom_ini_error_reporting }}\n"'\ + containers/php/custom.ini + perl -pi\ + -e 's#/var/www/#/var/www/source/#g;'\ + containers/httpd/project.conf + + - name: Login to Docker Hub + if: ${{ inputs.docker_login == 'true' && inputs.docker_user != '' }} + uses: docker/login-action@v3 + with: + username: ${{ inputs.docker_user }} + password: ${{ inputs.docker_token }} + + - name: Warn on missing docker credentials + if: ${{ inputs.docker_login == 'true' && inputs.docker_user == '' }} + shell: bash + run: | + # prepare_shop: Warn on missing docker credentials + # yamllint disable-line rule:line-length + MSG="Please set the repository secrets DOCKER_HUB_USER and DOCKER_HUB_TOKEN to avoid running into docker.io rate limiting" + echo "::warning title=Missing secrets::${MSG}" + + - name: Start containers + shell: bash + run: | + # prepare_shop: Start containers + ${{ inputs.debug }} + make up + docker compose ps --all + + - name: Output docker logs if make up failed + if: always() + shell: bash + run: | + # prepare_shop: Output docker logs if make up failed + echo -e "\033[0;35m### docker-compose.yml ###\033[0m" + cat docker-compose.yml + echo -e "\033[0;35m### docker compose logs ###\033[0m" + docker compose logs --tail=all + for c in $(docker ps -aq); do + echo -e "\033[0;35m### Logs for $c ###\033[0m" + docker logs -n 200 $c + done + + - name: Configure enterprise token + if: ${{ inputs.enterprise_github_token != '' }} + shell: bash + run: | + # prepare_shop: Configure enterprise token + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + composer config -g github-oauth.github.com "${{ inputs.enterprise_github_token }}" + + - name: 'Modify composer.json' + if: ${{ inputs.composer_transform != '' }} + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ inputs.composer_file }}' + backup: true + transform: | + ${{ inputs.composer_transform }} + update: false + update_options: ${{ inputs.composer_update_options }} + container_name: ${{ inputs.container_name }} + container_options: ${{ inputs.container_options }} + container_method: 'exec' + debug: ${{ inputs.debug }} + + - name: 'Modify composer.json for EE shop PR' + if: ${{ inputs.github_event_name == 'pull_request' && github.repository == 'OXID-eSales/oxideshop_ee' }} + # Deprecated for v5: This should be handled differently in the light workflow + uses: 'OXID-eSales/github-actions/composer_merge@v4' + with: + file: '${{ inputs.composer_file }}' + backup: true + transform: | + { + "require": { + "oxid-esales/oxideshop-ee": "dev-${{ steps.clone_ee_pr.outputs.module_ref }}" + }, + "repositories": { + "oxid-esales/oxideshop-ee": { + "type": "path", + "url": "./dev-packages/oxideshop_ee", + "options": { + "symlink": true + } + } + } + } + update: false + container_name: ${{ inputs.container_name }} + container_options: ${{ inputs.container_options }} + container_method: 'exec' + debug: ${{ inputs.debug }} + + # yamllint disable rule:line-length + - name: Modify composer.json to allow the same feature-branch + if: ${{ inputs.github_event_name != 'pull_request' }} + shell: bash + run: | + # prepare_shop: Modify composer.json to allow the same feature-branch + ${{ inputs.debug }} + if [ -f '${{ inputs.composer_file }}' ]; then + BASE_BRANCH_PATTERN='^b-[0-9]+\.[0-9]+\.x$' + if [[ '${{ inputs.github_ref_name }}' =~ $BASE_BRANCH_PATTERN ]]; then + echo -e "\033[0;35mNot modifying composer.json because ${{ inputs.github_ref_name }} is a base branch\033[0m" + else + echo -e "\033[0;35mAllow dev-${{ inputs.github_ref_name }} for oxid-esales requires\033[0m" + sed -e 's#"oxid-esales/\(.*\)":[[:space:]]*"${{ inputs.composer_dev_ref }}"#"oxid-esales/\1": "dev-${{ inputs.github_ref_name }} || ${{ inputs.composer_dev_ref }}"#' \ + -i.backup '${{ inputs.composer_file }}' + fi + fi + touch module_repositories.json + # yamllint enable rule:line-length + + - name: Install dependencies + shell: bash + if: ${{ inputs.composer_update == 'true' }} + run: | + # prepare_shop: Install dependencies + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + composer update --no-interaction + + - name: Setup config inc file + shell: bash + run: | + # prepare_shop: Setup config inc file + ${{ inputs.debug }} + if [ -f source/source/config.inc.php.dist ]; then + cp source/source/config.inc.php.dist source/source/config.inc.php + fi + 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 <source/custom_script.sh <<'EOF' + #!/bin/bash + ${{ inputs.custom_script_container }} + EOF + # This is necessary due to the 'EOF' now + sed -e 's|^ ||' -i.backup source/custom_script.sh + chmod 0755 source/custom_script.sh + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + ${TOKEN_OPTION} \ + ${{ inputs.container_name}} \ + /var/www/custom_script.sh + rm source/custom_script.sh diff --git a/run_test_script/action.yaml.backup b/run_test_script/action.yaml.backup new file mode 100644 index 00000000..4e727eb2 --- /dev/null +++ b/run_test_script/action.yaml.backup @@ -0,0 +1,165 @@ +name: 'run_test_script' +description: 'Configures styles' +inputs: + script: + type: string + required: true + description: 'script to run' + path: + type: string + required: true + description: 'Workdir for the script' + workdir: + type: string + required: false + description: 'Workdir for the script' + default: '' + run_composer_install: + type: boolean + required: false + description: 'run composer install in the workdir' + default: true + install_options: + type: string + required: false + description: 'Options to pass along to composer when running composer install' + default: '' + container_name: + type: string + required: false + description: 'Name of the container to run the test in' + default: 'php' + container_options: + type: string + required: false + description: 'Additional options to pass into the container' + default: '' + container_method: + type: string + required: false + description: 'Method to execute the commands inside a container, either "run" or "exec"' + default: 'exec' + output_artifact: + type: string + required: false + description: 'Github run artifact for the output' + default: 'run_test_script' + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + github_token: + type: string + description: 'Github token for composer' + default: '' + required: false + +runs: + using: "composite" + steps: + - name: Run composer script + if: ${{ ! startsWith(inputs.script, '~/') }} + shell: bash + run: | + # run_test_script: Run composer script ${{ inputs.script }} + ${{ inputs.debug }} + TESTDIR='tests' + if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then + TESTDIR='Tests' + if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then + echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }}, creating it ###\033[0m" + TESTDIR='tests' + mkdir -p "source/${{ inputs.path }}/${TESTDIR}" + fi + fi + mkdir -p source/${{ inputs.path }}/${TESTDIR}/Output source/${{ inputs.path }}/${TESTDIR}/Reports + echo -e "\033[0;35m### Run composer ${{ inputs.script }} in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + -e GITHUB_TOKEN=${{ inputs.github_token }} \ + ${{ inputs.container_options }} \ + -e ABSOLUTE_PATH=${{ inputs.path }} \ + --workdir '/var/www/${{ inputs.workdir }}' \ + ${{ inputs.container_name }} \ + composer ${{ inputs.script }} + + - name: Run shell script + if: ${{ startsWith(inputs.script, '~/' ) }} + shell: bash + run: | + # run_test_script: Run shell script ${{ inputs.script }} + ${{ inputs.debug }} + TESTDIR='tests' + if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then + TESTDIR='Tests' + if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then + echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }} ###\033[0m" + exit 1 + fi + fi + echo -e "\033[0;35m### Using ${TESTDIR}/Output to generate the artifact ###\033[0m" + mkdir -p "source/${{ inputs.path }}/${TESTDIR}/Output" "source/${{ inputs.path }}/${TESTDIR}/Reports" + SCRIPT=$(echo '${{ inputs.script }}'|sed -e "s|^~/|${TESTDIR}/Scripts/|") + if [ ! -f "source/${{ inputs.path }}/${SCRIPT}" ]; then + SCRIPT=$(echo '${{ inputs.script }}'|sed -e "s|^~/|${TESTDIR}/scripts/|") + fi + S=$(echo "${SCRIPT}"|sed -e 's|\s.*||') + if [ ! -f "source/${{ inputs.path }}/${S}" ]; then + echo -e "\033[0;31m### Could not find source/${{ inputs.path }}/${S} ###\033[0m" + fi + chmod a+x "source/${{ inputs.path }}/${S}" + echo -e "\033[0;35m### Run ${SCRIPT} in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + -e GITHUB_TOKEN=${{ inputs.github_token }} \ + ${{ inputs.container_options }} \ + -e ABSOLUTE_PATH=${{ inputs.path }} \ + --workdir '/var/www/${{ inputs.workdir }}' \ + ${{ inputs.container_name }} \ + /var/www/${{ inputs.path }}/${SCRIPT} + + - name: Output php error log + if: always() + shell: bash + run: | + # run_test_script: Output php error log + ${{ inputs.debug }} + TESTDIR='tests' + if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then + TESTDIR='Tests' + if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then + echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }}, creating it ###\033[0m" + TESTDIR='tests' + fi + fi + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + touch data/php/logs/error_log.txt + mkdir -p "source/${{ inputs.path }}/${TESTDIR}/Output" + cp source/composer.json source/${{ inputs.path }}/${TESTDIR}/Output/ + cp source/composer.lock source/${{ inputs.path }}/${TESTDIR}/Output/ + cp data/php/logs/error_log.txt source/${{ inputs.path }}/${TESTDIR}/Output/ + cp data/mysql/mysql/slow_log* source/${{ inputs.path }}/${TESTDIR}/Output/ + cp data/mysql/mysql/general_log* source/${{ inputs.path }}/${TESTDIR}/Output/ + if [ -f source/source/log/oxideshop.log ]; then + mkdir -p source/${{ inputs.path }}/${TESTDIR}/Output/source/log + cp source/source/log/oxideshop.log source/${{ inputs.path }}/${TESTDIR}/Output/source/log/ + fi + if [ -f source/vendor/oxid-esales/oxideshop-ce/log/oxideshop.log ]; then + mkdir -p source/${{ inputs.path }}/${TESTDIR}/Output/source/vendor/oxid-esales/oxideshop-ce/log + cp source/vendor/oxid-esales/oxideshop-ce/log/oxideshop.log source/${{ inputs.path }}/${TESTDIR}/Output/source/vendor/oxid-esales/oxideshop-ce/log/ + fi + docker compose logs --tail=all >source/${{ inputs.path }}/${TESTDIR}/Output/docker-compose.log + for c in $(docker ps -aq); do + docker logs -n 2000 $c &>source/${{ inputs.path }}/${TESTDIR}/Output/docker-$c.log + done + + - name: Upload artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: | + source/${{ inputs.path }}/tests/Output/* + source/${{ inputs.path }}/Tests/Output/* diff --git a/runtests/action.yaml.backup b/runtests/action.yaml.backup new file mode 100644 index 00000000..6f298553 --- /dev/null +++ b/runtests/action.yaml.backup @@ -0,0 +1,177 @@ +name: 'runtests' +description: 'Executes vendor/bin/runtests in a running container and uploads the logs as artefacts' +inputs: + container_name: + type: string + required: false + description: 'Name of the container to run the test in' + default: 'php' + container_options: + type: string + required: false + description: 'Additional options to pass into the container' + default: '' + container_method: + type: string + required: false + description: 'Method to execute the commands inside a container, either "run" or "exec"' + default: 'exec' + reset_shop: + type: boolean + required: false + description: 'Should we run vendor/bin/reset-shop before the test' + default: true + test: + type: string + required: false + description: 'Name of the test or folder to run' + default: 'AllTestsUnit' + additional_options: + type: string + required: false + description: 'Optional: Additional options to pass to phpunit' + default: '' + logfile: + type: string + required: false + description: 'Name of the output logfile' + default: 'deprecated_tests_log.txt' + output_files: + type: string + required: false + description: 'phpunit output and test settings' + default: | + source/unit.cov + source/source/log/oxideshop.log + data/php/logs/error_log.txt + output_artifact: + type: string + required: false + description: 'Github run artifact for the phpunit output' + default: 'phpunit-artifacts' + coverage_path: + type: string + required: false + description: 'Path for the coverage file, not uploaded if it is empty' + default: '' + coverage_artifact: + type: string + required: false + description: 'Github run artifact for the coverage file' + default: 'coverage-reports' + failure_pattern: + type: string + required: false + description: 'Grep pattern which indicate that the test failed' + default: 'fail|\\.\\=\\=|Warning|Notice|Deprecated|Fatal|Error|DID NOT FINISH' + reset_shop_binary: + type: string + required: false + description: 'Location of the reset-shop binary' + default: 'vendor/bin/reset-shop' + runtests_binary: + type: string + required: false + description: 'Location of the runtests binary' + default: 'vendor/bin/runtests' + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + +runs: + using: "composite" + steps: + - name: Reset shop + if: ${{ inputs.reset_shop == 'true' }} + shell: bash + run: | + # runtests: Reset shop + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + php ${{ inputs.reset_shop_binary }} + + - name: Run runtest + shell: bash + run: | + # runtests: Run runtest + ${{ inputs.debug }} + docker compose ${{ inputs.container_method }} -T ${{ inputs.container_options }} \ + ${{ inputs.container_name}} \ + php ${{ inputs.runtests_binary }} \ + ${{ inputs.additional_options }} \ + ${{ inputs.test }} \ + | tee "${{ inputs.logfile }}" 2>&1 || true + + - name: Upload Artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: | + ${{ inputs.logfile }} + ${{ inputs.output_files }} + ${{ inputs.coverage_path }} + if-no-files-found: ignore + retention-days: 4 + + - name: Upload Coverage Report + if: ${{ always() && inputs.coverage_path != '' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.coverage_artifact }} + path: ${{ inputs.coverage_path }} + if-no-files-found: ignore + retention-days: 4 + + - name: Output php error log + if: always() + shell: bash + run: | + # runtests: Output php error log + ${{ inputs.debug }} + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + + - name: Check results + shell: bash + run: | + # runtests: Check results + ${{ inputs.debug }} + PURPLE=$(echo -e "\033[0;31m") + NOCOLOR=$(echo -e "\033[0m") + if [ ! -s "${{ inputs.logfile }}" ]; then + cat <failure_pattern.tmp <\\n\" }" + fi + done + if [ -n "${PAYLOAD}" ]; then + PAYLOAD=" {\"type\": \"divider\"}, + { \"type\": \"context\", + \"elements\": [${PAYLOAD:1} + ] + }," + fi + } + + STATUS=(Skipped Success Cancelled Failure) + EMOJI=(':white_circle:' ':white_check_mark:' ':black_circle:' ':x:') + OVERALL_STATUS=0 + generate_list "$(echo "${INPUT_SUMMARY_LIST}"|tr '\n' ' ')" true + SUMMARY_PAYLOAD="${PAYLOAD}" + generate_list "$(echo "${INPUT_INSTALL_LIST}"|tr '\n' ' ')" + INSTALL_PAYLOAD="${PAYLOAD}" + generate_list "$(echo "${INPUT_TEST_LIST}"|tr '\n' ' ')" + TEST_PAYLOAD="${PAYLOAD}" + generate_list "$(echo "${INPUT_REPORT_LIST}"|tr '\n' ' ')" + REPORT_PAYLOAD="${PAYLOAD}" + + cat >'payload.yaml' <> $GITHUB_ENV + + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + SONAR_TOKEN: ${{ inputs.sonar_token }} + GITHUB_TOKEN: ${{ inputs.github_token }} + with: + args: > + -Dsonar.organization=${{ inputs.sonarcloud_organization }} + -Dsonar.projectKey=${{ inputs.sonarcloud_project_key }} + -Dsonar.projectName=${{ inputs.sonarcloud_project_name }} + -Dsonar.branch.name=${{ inputs.github_ref_name }} + ${{ env.COVERAGE_PARAM }} + ${{ env.PHPUNIT_PARAM }} + ${{ inputs.sonarcloud_parameters }} + ${{ env.TARGET_BRANCH_PARAM }} + + - name: Debug Sonarcloud scan + if: ${{ inputs.debug != '' }} + shell: bash + run: | + # sonarcloud: Debug sonarcloud Scan (simulated) + cat >debug/debug.sh <debug/debug.sh + + - name: Login to Docker Hub + if: ${{ inputs.docker_login == 'true' && inputs.docker_user != '' }} + uses: docker/login-action@v3 + with: + username: ${{ inputs.docker_user }} + password: ${{ inputs.docker_token }} + + - name: Warn on missing docker credentials + if: ${{ inputs.docker_login == 'true' && inputs.docker_user == '' }} + shell: bash + run: | + # prepare_shop: Warn on missing docker credentials + MSG="Please set the repository secrets DOCKER_HUB_USER and DOCKER_HUB_TOKEN to avoid running into docker.io rate limiting" + echo "::warning title=Missing secrets::${MSG}" + + - name: Start containers + shell: bash + run: | + # start_shop: Start containers + ${{ inputs.debug }} + echo -e "\033[0;35m### Starting containers\033[0m" + make up + + - name: Output docker logs if make up failed + if: failure() + shell: bash + run: | + # start_shop: Output docker logs if make up failed + echo -e "\033[0;31m### Starting containers failed\033[0m" + cat docker-compose.yml + docker compose logs --tail=all + for c in $(docker ps -aq); do + echo "*** Logs for $c ***" + docker logs -n 200 $c + done + + - name: Wait for selenium + if: ${{ inputs.wait_for_selenium == 'true' }} + shell: bash + run: | + # start_shop: Wait for selenium + ${{ inputs.debug }} + cat >source/wait_for_selenium.sh <<'EOF' + #!/bin/bash + set +e + sleep 2 + I=60 + until [ $I -le 0 ]; do + curl -sSjkL http://selenium:4444/wd/hub/status |grep '"ready": true' && break + echo "." + sleep 1 + ((I--)) + done + set -e + curl -sSjkL http://selenium:4444/wd/hub/status + EOF + sed -e 's|^ *||' -i.backup source/wait_for_selenium.sh + chmod 0755 source/wait_for_selenium.sh + docker compose exec -T \ + ${{ inputs.container_name}} \ + /var/www/wait_for_selenium.sh + rm source/wait_for_selenium.sh diff --git a/stop_shop/action.yaml.backup b/stop_shop/action.yaml.backup new file mode 100644 index 00000000..5bbe9f0b --- /dev/null +++ b/stop_shop/action.yaml.backup @@ -0,0 +1,19 @@ +name: 'stop_shop' +description: 'Stops a running shop instance' +inputs: + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + +runs: + using: "composite" + steps: + - name: Stop containers + if: always() + shell: bash + run: | + # stop_shop: Stop containers + ${{ inputs.debug }} + docker compose down diff --git a/styles/action.yaml.backup b/styles/action.yaml.backup new file mode 100644 index 00000000..983519cb --- /dev/null +++ b/styles/action.yaml.backup @@ -0,0 +1,161 @@ +name: 'styles' +description: 'Configures styles' +inputs: + path: + type: string + required: true + description: 'Folder to run the tests in' + module_ids: + type: string + required: true + description: 'Moduleids' + install_options: + type: string + required: false + description: 'Options to pass along to composer when running composer install' + default: '' + container_name: + type: string + required: false + description: 'Name of the container to run the test in' + default: 'php' + container_options: + type: string + required: false + description: 'Additional options to pass into the container' + default: '' + container_method: + type: string + required: false + description: 'Method to execute the commands inside a container, either "run" or "exec"' + default: 'exec' + output_files: + type: string + required: false + description: 'phpunit output and test settings' + default: | + source/tests/reports/phpstan*.report.json + source/tests/reports/phpmd*.report.json + source/tests/reports/phpcs*.report.json + source/tests/reports/phpstan*.report.txt + source/tests/reports/phpmd*.report.txt + source/tests/reports/phpcs*.report.txt + data/php/logs/error_log.txt + output_artifact: + type: string + required: false + description: 'Github run artifact for the styles output' + default: 'StylesLog' + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + +runs: + using: "composite" + steps: + - name: Run composer install + shell: bash + run: | + # styles: Run composer install + ${{ inputs.debug }} + WD=$(pwd) + mkdir -p source/tests/reports "source/dev-packages/${{ inputs.path }}/tests" + cd "source/dev-packages/${{ inputs.path }}/tests" + if [ ! -d reports ]; then + ln -s ../../../tests/reports + fi + cd "${WD}" + echo -e "\033[0;35m### Running composer install with ${{ inputs.install_options }}\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + --workdir '/var/www/dev-packages/${{ inputs.path }}' \ + ${{ inputs.container_name }} \ + composer install ${{ inputs.install_options }} + + - name: Run phpstan + id: phpstan + shell: bash + run: | + # styles: Run phpstan + ${{ inputs.debug }} + echo -e "\033[0;35m### Run phpstan-report in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + --workdir '/var/www/dev-packages/${{ inputs.path }}' \ + ${{ inputs.container_name }} \ + composer phpstan-report + echo -e "\033[0;35m### Run phpstan in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + --workdir '/var/www/dev-packages/${{ inputs.path }}' \ + ${{ inputs.container_name }} \ + composer phpstan | tee -a source/tests/reports/phpstan-${{ inputs.module_ids }}.report.txt + if [ -f source/dev-packages/${{ inputs.path }}/phpstan.report.json ]; then + mv source/dev-packages/${{ inputs.path }}/phpstan.report.json source/tests/reports/phpstan-${{ inputs.module_ids }}.report.json + fi + + - name: Run phpmd + id: phpmd + if: always() + continue-on-error: true + shell: bash + run: | + # styles: Run phpmd + ${{ inputs.debug }} + echo -e "\033[0;35m### Run phpmd-report in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + --workdir '/var/www/dev-packages/${{ inputs.path }}' \ + ${{ inputs.container_name }} \ + composer phpmd-report + echo -e "\033[0;35m### Run phpmd in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + --workdir '/var/www/dev-packages/${{ inputs.path }}' \ + ${{ inputs.container_name }} \ + composer phpmd | tee -a source/tests/reports/phpmd-${{ inputs.module_ids }}.report.txt + if [ -f source/dev-packages/${{ inputs.path }}/phpmd.report.json ]; then + mv source/dev-packages/${{ inputs.path }}/phpmd.report.json source/tests/reports/phpmd-${{ inputs.module_ids }}.report.json + fi + + - name: Run phpcs + if: always() + shell: bash + run: | + # styles: Run phpcs + ${{ inputs.debug }} + echo -e "\033[0;35m### Run phpcs-report in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + --workdir '/var/www/dev-packages/${{ inputs.path }}' \ + ${{ inputs.container_name }} \ + composer phpcs-report + echo -e "\033[0;35m### Run phpcs in ${{ inputs.path }} ###\033[0m" + docker compose ${{ inputs.container_method }} -T \ + ${{ inputs.container_options }} \ + --workdir '/var/www/dev-packages/${{ inputs.path }}' \ + ${{ inputs.container_name }} \ + composer phpcs | tee -a source/tests/reports/phpcs-${{ inputs.module_ids }}.report.txt + if [ -f source/dev-packages/${{ inputs.path }}/phpcs.report.json ]; then + mv source/dev-packages/${{ inputs.path }}/phpcs.report.json source/tests/reports/phpcs-${{ inputs.module_ids }}.report.json + fi + + - name: Output php error log + if: always() + shell: bash + run: | + # styles: Output php error log + ${{ inputs.debug }} + if [ -s data/php/logs/error_log.txt ]; then + echo -e "\033[0;35mPHP error log\033[0m" + cat data/php/logs/error_log.txt + fi + + - name: Upload artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output_artifact }} + path: ${{ inputs.output_files }} diff --git a/yamllint/action.yaml.backup b/yamllint/action.yaml.backup new file mode 100644 index 00000000..3233a227 --- /dev/null +++ b/yamllint/action.yaml.backup @@ -0,0 +1,84 @@ +name: 'YAML Lint' +description: 'Validate YAML syntax' +author: 'ibiqlik' + +inputs: + file_or_dir: + description: 'File(s) or Directory, separate by space if multiple files or folder are specified' + required: false + config_file: + description: 'Path to custom configuration' + required: false + config_data: + description: 'Custom configuration (as YAML source)' + required: false + format: + description: 'Format for parsing output [parsable,standard,colored,github,auto]' + required: false + default: "parsable" + strict: + description: 'Return non-zero exit code on warnings as well as errors' + required: false + default: "false" + no_warnings: + description: 'Output only error level problems' + required: false + default: "false" + debug: + type: string + description: 'Appended to debugging scripts' + default: '' + required: false + +outputs: + logfile: + description: "Yamllint log file path" + value: ${{ steps.yamllint.outputs.logfile }} + +runs: + using: 'composite' + steps: + - id: yamllint + run: | + # yamllint: yamllint + ${{ inputs.debug }} + # shellcheck disable=SC2086 + + YL=$(type -p 'yamllint'||true) + if [ -z "${YL}" ]; then + echo -e "\033[0;35m### Installing yamllint ###\033[0m" + sudo apt-get update + sudo apt-get -qq install yamllint + fi + set -o pipefail + if [[ -z "$LOGFILE" ]]; then + LOGFILE=$(mktemp yamllint-XXXXXX) + fi + if [[ -n "$INPUT_CONFIG_FILE" ]]; then + options+=(-c "$INPUT_CONFIG_FILE") + fi + if [[ -n "$INPUT_CONFIG_DATA" ]]; then + options+=(-d "$INPUT_CONFIG_DATA") + fi + options+=(-f "$INPUT_FORMAT") + if [[ "$INPUT_STRICT" == "true" ]]; then + options+=(-s) + fi + if [[ "$INPUT_NO_WARNINGS" == "true" ]]; then + options+=(--no-warnings) + fi + # Enable globstar so ** globs recursively + shopt -s globstar + yamllint "${options[@]}" ${INPUT_FILE_OR_DIR:-.} | tee -a "$LOGFILE" + exitcode=$? + shopt -u globstar + echo "logfile=$(realpath ${LOGFILE})" >> "$GITHUB_OUTPUT" + exit $exitcode + shell: bash + env: + INPUT_FILE_OR_DIR: ${{ inputs.file_or_dir }} + INPUT_CONFIG_FILE: ${{ inputs.config_file }} + INPUT_CONFIG_DATA: ${{ inputs.config_data }} + INPUT_FORMAT: ${{ inputs.format }} + INPUT_STRICT: ${{ inputs.strict }} + INPUT_NO_WARNINGS: ${{ inputs.no_warnings }}