From 46667da491bad2cde49352126f90f8fb4751ed52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Thu, 29 Feb 2024 14:22:53 +0100 Subject: [PATCH 1/9] Use exact module reference in install_module and comment redundant code --- install_module/action.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/install_module/action.yml b/install_module/action.yml index 26213f03..0104def5 100644 --- a/install_module/action.yml +++ b/install_module/action.yml @@ -124,20 +124,20 @@ runs: composer config -g github-oauth.github.com "${{ inputs.enterprise_github_token }}" fi - - name: Install module - shell: bash - run: | - # install_module: Install module - ${{ inputs.debug }} - docker compose ${{ inputs.container_method }} -T \ - ${{ inputs. container_options }} \ - ${{ inputs.container_name}} \ - composer config repositories.${{ inputs.package_name }} \ - --json '{"type":"path", "url":"./${{inputs.module_path}}", "options": {"symlink": true}}' - docker compose ${{ inputs.container_method }} -T \ - ${{ inputs. container_options }} \ - ${{ inputs.container_name}} \ - composer require ${{ inputs.package_name }}:* --no-interaction --no-update + # - name: Install module + # shell: bash + # run: | + # # install_module: Install module + # ${{ inputs.debug }} + # docker compose ${{ inputs.container_method }} -T \ + # ${{ inputs. container_options }} \ + # ${{ inputs.container_name}} \ + # composer config repositories.${{ inputs.package_name }} \ + # --json '{"type":"path", "url":"./${{inputs.module_path}}", "options": {"symlink": true}}' + # docker compose ${{ inputs.container_method }} -T \ + # ${{ inputs. container_options }} \ + # ${{ inputs.container_name}} \ + # composer require ${{ inputs.package_name }}:${{ inputs.git_module_ref }} --no-interaction --no-update - name: 'Modify composer.json' uses: 'OXID-eSales/github-actions/composer_merge@v4alpha' @@ -147,7 +147,7 @@ runs: transform: | { "require": { - "${{ inputs.package_name }}": "*" + "${{ inputs.package_name }}": "${{ inputs.git_module_ref }} " }, "repositories": { "${{ inputs.package_name }}": { @@ -171,10 +171,10 @@ runs: 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}} \ + # composer update --no-interaction docker compose ${{ inputs.container_method }} -T \ ${{ inputs. container_options }} \ ${{ inputs.container_name}} \ From 5767866104dfbf9881d1a846ddd035916455a85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Thu, 29 Feb 2024 14:50:48 +0100 Subject: [PATCH 2/9] Limit festure-branch modification --- prepare_shop/action.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/prepare_shop/action.yml b/prepare_shop/action.yml index 18616e16..c4639a21 100644 --- a/prepare_shop/action.yml +++ b/prepare_shop/action.yml @@ -262,8 +262,14 @@ runs: # prepare_shop: Modify composer.json to allow the same feature-branch ${{ inputs.debug }} if [ -f '${{ inputs.composer_file }}' ]; then - sed -e 's#"oxid-esales/\(.*\)":[[:space:]]*"${{ inputs.composer_dev_ref }}"#"oxid-esales/\1": "dev-${{ inputs.github_ref_name }} || ${{ inputs.composer_dev_ref }}"#' \ - -i '${{ inputs.composer_file }}' + 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 '${{ inputs.composer_file }}' + fi fi # yamllint enable rule:line-length From 9f466d55a530920b23adc8999ea440d942f45113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Thu, 29 Feb 2024 16:46:24 +0100 Subject: [PATCH 3/9] Swich prepare_shop and install_module to v0 --- .github/workflows/call-universal_test_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index fb1be354..b5b27116 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -274,7 +274,7 @@ jobs: steps: - name: 'Prepare Shop' id: prepare_shop - uses: 'OXID-eSales/github-actions/prepare_shop@v4' + uses: 'OXID-eSales/github-actions/prepare_shop@v0' with: container_name: ${{ needs.init.outputs.prepare_shop_container_name }} container_options: ${{ needs.init.outputs.prepare_shop_container_options }} @@ -547,7 +547,7 @@ jobs: - name: Install module if: ${{ matrix.testplan != 'skip' }} id: install_module - uses: 'OXID-eSales/github-actions/install_module@v4' + uses: 'OXID-eSales/github-actions/install_module@v0' with: container_name: ${{ steps.install_module_testplan.outputs.install_module_container_name }} container_options: ${{ steps.install_module_testplan.outputs.install_module_container_options }} From 7ea27755dad9321f05c26f7b60477acad10f0167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Fri, 1 Mar 2024 11:37:54 +0100 Subject: [PATCH 4/9] Fix styles problem and move delete_artifact to the end of the respective actions --- .../workflows/call-universal_test_workflow.yml | 17 +++++++++++++++-- generate_report/action.yml | 8 +------- sonarcloud/action.yml | 6 ------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index b5b27116..926fab23 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -1078,7 +1078,7 @@ jobs: - name: 'SonarCloud Scan' uses: 'OXID-eSales/github-actions/sonarcloud@v4' with: - coverage_artifact: 'coverage-reports-**-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' + coverage_artifact: 'coverage-reports-*-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' output_artifact: 'coverage-reports' target_branch: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_target_branch }} strip_path: ${{ steps.sonarcloud_testplan.outputs.sonarcloud_strip_path }} @@ -1260,7 +1260,7 @@ jobs: priority: '230' phase: report job: styles - title: '${{ steps.styles_testplan.outputs.title }}' + title: '${{ steps.styles_testplan.outputs.styles_title }}' php: ${{matrix.php}} mysql: ${{matrix.mysql}} status: ${{job.status}} @@ -1388,3 +1388,16 @@ jobs: cache_objects: | ${{ steps.generate_report.outputs.cache_objects }} debug: ${{ needs.init.outputs.debug }} + + - name: 'Remove temporary testplan artifacts' + uses: geekyeggo/delete-artifact@v4 + with: + name: 'testplan-*' + useGlob: true + failOnError: false + + - name: 'Remove temporary coverage artifacts' + uses: geekyeggo/delete-artifact@v4 + with: + name: 'coverage-reports-*' + failOnError: false diff --git a/generate_report/action.yml b/generate_report/action.yml index 0b07f7bb..97bfe13a 100644 --- a/generate_report/action.yml +++ b/generate_report/action.yml @@ -190,13 +190,6 @@ runs: path: '**' retention-days: 7 - - name: 'Remove temporary testplan artifacts' - uses: geekyeggo/delete-artifact@v4 - with: - name: 'testplan-*' - useGlob: true - failOnError: false - - name: Send custom JSON data to Slack workflow if: ${{ inputs.slack_webhook != '' }} uses: slackapi/slack-github-action@v1 @@ -205,3 +198,4 @@ runs: env: SLACK_WEBHOOK_URL: ${{ inputs.slack_webhook }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + diff --git a/sonarcloud/action.yml b/sonarcloud/action.yml index fbe37d39..c0f22194 100644 --- a/sonarcloud/action.yml +++ b/sonarcloud/action.yml @@ -102,12 +102,6 @@ runs: name: ${{ inputs.output_artifact }} path: coverage-reports - - name: 'Remove temporary coverage artifacts' - uses: geekyeggo/delete-artifact@v4 - with: - name: '${{ inputs.coverage_artifact }}' - failOnError: false - - name: Set target branch shell: bash run: | From 71b3c7134c08fb5d458266e8454337e34e1fd3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Fri, 1 Mar 2024 11:38:34 +0100 Subject: [PATCH 5/9] Fix styles problem and move delete_artifact to the end of the respective actions --- .github/workflows/call-universal_test_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index 926fab23..6dfcb15b 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -1076,7 +1076,7 @@ jobs: fetch-depth: 0 - name: 'SonarCloud Scan' - uses: 'OXID-eSales/github-actions/sonarcloud@v4' + uses: 'OXID-eSales/github-actions/sonarcloud@v0' with: coverage_artifact: 'coverage-reports-*-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' output_artifact: 'coverage-reports' @@ -1369,7 +1369,7 @@ jobs: - name: 'Generate report' id: generate_report - uses: 'OXID-eSales/github-actions/generate_report@v4' + uses: 'OXID-eSales/github-actions/generate_report@v0' with: slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }} title: '${{ needs.init.outputs.finish_slack_title }}' From 9dfdb47622cf82ffb01ef01b0d2643095c92fd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Fri, 1 Mar 2024 11:58:54 +0100 Subject: [PATCH 6/9] Fix install_module --- install_module/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_module/action.yml b/install_module/action.yml index 0104def5..d3e73f32 100644 --- a/install_module/action.yml +++ b/install_module/action.yml @@ -147,7 +147,7 @@ runs: transform: | { "require": { - "${{ inputs.package_name }}": "${{ inputs.git_module_ref }} " + "${{ inputs.package_name }}": "dev-${{ inputs.git_module_ref }}" }, "repositories": { "${{ inputs.package_name }}": { From cfe9e2f9b550db3b0c6d136140c86252ce9397b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Fri, 1 Mar 2024 13:36:50 +0100 Subject: [PATCH 7/9] Always cleanup plans --- .github/workflows/call-universal_test_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index 6dfcb15b..86b9f388 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -1390,6 +1390,7 @@ jobs: debug: ${{ needs.init.outputs.debug }} - name: 'Remove temporary testplan artifacts' + if: ${{ always() }} uses: geekyeggo/delete-artifact@v4 with: name: 'testplan-*' @@ -1397,6 +1398,7 @@ jobs: failOnError: false - name: 'Remove temporary coverage artifacts' + if: ${{ always() }} uses: geekyeggo/delete-artifact@v4 with: name: 'coverage-reports-*' From 56403bba1b47bc20cf86e222e96f4c02355a03e7 Mon Sep 17 00:00:00 2001 From: joernott Date: Fri, 1 Mar 2024 12:46:20 +0000 Subject: [PATCH 8/9] Update versions --- .github/workflows/call-universal_test_workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index 86b9f388..7370fbd1 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -274,7 +274,7 @@ jobs: steps: - name: 'Prepare Shop' id: prepare_shop - uses: 'OXID-eSales/github-actions/prepare_shop@v0' + 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 }} @@ -547,7 +547,7 @@ jobs: - name: Install module if: ${{ matrix.testplan != 'skip' }} id: install_module - uses: 'OXID-eSales/github-actions/install_module@v0' + 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 }} @@ -1076,7 +1076,7 @@ jobs: fetch-depth: 0 - name: 'SonarCloud Scan' - uses: 'OXID-eSales/github-actions/sonarcloud@v0' + uses: 'OXID-eSales/github-actions/sonarcloud@v4' with: coverage_artifact: 'coverage-reports-*-${{ steps.sonarcloud_testplan_name.outputs.matrix_suffix }}' output_artifact: 'coverage-reports' @@ -1369,7 +1369,7 @@ jobs: - name: 'Generate report' id: generate_report - uses: 'OXID-eSales/github-actions/generate_report@v0' + uses: 'OXID-eSales/github-actions/generate_report@v4' with: slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }} title: '${{ needs.init.outputs.finish_slack_title }}' From 2b24b5226e16ea83968285c48d3ae5a53ff5e959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ott?= Date: Fri, 1 Mar 2024 13:47:36 +0100 Subject: [PATCH 9/9] lint --- generate_report/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/generate_report/action.yml b/generate_report/action.yml index 97bfe13a..ae733345 100644 --- a/generate_report/action.yml +++ b/generate_report/action.yml @@ -198,4 +198,3 @@ runs: env: SLACK_WEBHOOK_URL: ${{ inputs.slack_webhook }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK -