diff --git a/.github/oxid-esales/module-usercentrics.yaml b/.github/oxid-esales/module-usercentrics.yaml index 2cee844..351e19f 100644 --- a/.github/oxid-esales/module-usercentrics.yaml +++ b/.github/oxid-esales/module-usercentrics.yaml @@ -24,14 +24,14 @@ install_module: phpunit: matrix: - testplan: '["~/defaults/module_phpunit_unit.yml","~/defaults/module_phpunit_integration.yml"]' + testplan: '["~/defaults/module_phpunit_unit.yaml","~/defaults/module_phpunit_integration.yaml"]' load_shop: *install_module_prefix codeception: matrix: testplan: '["-"]' load_shop: *install_module_prefix - title: 'codeception' + title: '{{ print $name }}-{{ print $order }}' container: options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e XDEBUG_MODE=coverage -e THEME_ID=apex' configuration: '/var/www/vendor/oxid-professional-services/usercentrics/tests/codeception.yml' @@ -47,13 +47,15 @@ codeception: runtest: matrix: testplan: 'skip' + title: '{{ print $name }}-{{ print $order }}' load_shop: *install_module_prefix sonarcloud: matrix: testplan: '["-"]' - project_key: '{{ print $sonarKey }}' - project_name: *package_name + strip_path: '/var/www/vendor/oxid-esales/security-module/' + project_key: 'OXID-eSales_usercentrics' + project_name: 'oxid-esales/usercentrics' parameters: | -Dsonar.language=php -Dsonar.scm.provider=git @@ -66,9 +68,10 @@ phpcs_tests: styles: matrix: testplan: '["-"]' + title: '{{ print $name }}-{{ print $order }}' load_shop: *install_module_prefix path: *ids module_ids: *ids finish: - slack_title: 'Module {{ print $name }} {{ .Github.RefName }} on {{ .Github.Repository }} by {{ .Github.Actor }}' \ No newline at end of file + slack_title: 'Module {{ print $name }} ({{ .Github.RefName }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' diff --git a/.github/workflows/dispatch_dev_module.yaml b/.github/workflows/dispatch_dev_module.yaml deleted file mode 100644 index d58d8dd..0000000 --- a/.github/workflows/dispatch_dev_module.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Manual trigger for testing github actions development - -on: - workflow_dispatch: - inputs: - testplan: - type: string - required: true - description: 'URL/PATH of the testplan to run' - default: 'tests/github_actions/defaults/7.1.x.yml,tests/github_actions/module-usercentrics.yaml' - runs_on: - type: string - description: 'JSON string/array describing the runner' - required: true - default: '"ubuntu-latest"' - -jobs: - call_matrix: - uses: OXID-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v0 - with: - testplan: ${{ inputs.testplan }} - runs_on: ${{ inputs.runs_on }} - defaults: 'v0' - secrets: - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} - DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} - CACHE_ENDPOINT: ${{ secrets.CACHE_ENDPOINT }} - CACHE_ACCESS_KEY: ${{ secrets.CACHE_ACCESS_KEY }} - CACHE_SECRET_KEY: ${{ secrets.CACHE_SECRET_KEY }} - enterprise_github_token: ${{ secrets.enterprise_github_token }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dispatch_module.yaml b/.github/workflows/dispatch_module.yaml index f5ceaf2..bfdbbe9 100644 --- a/.github/workflows/dispatch_module.yaml +++ b/.github/workflows/dispatch_module.yaml @@ -1,15 +1,9 @@ -name: Manual stable trigger +name: Manual trigger +# Matrix workflow using re-usable github actions on: workflow_dispatch: inputs: - scenario: - type: choice - options: - - 7.1.x - - use custom testplan - default: '7.1.x' - description: 'Choose test scenario' limit: type: choice options: @@ -18,22 +12,67 @@ on: - 'PHP8.1/MySQL8.0' - 'PHP8.2/MySQL5.7' - 'PHP8.2/MySQL8.0' - default: 'PHP8.1/MySQL5.7' + default: 'PHP8.2/MySQL8.0' description: 'Limit to one PHP/MySQL combination' - custom_testplan: - type: string - required: true - description: 'URL/PATH of the testplan to run' - default: '~/defaults/7.1.x.yaml,~/module-usercentrics.yaml' + use_dev_version: + type: choice + options: ['no', 'v0'] + description: 'Use the dev version of github actions' + default: 'no' jobs: - pull_module: + build_testplan: + runs-on: 'ubuntu-latest' + outputs: + testplan: '${{ steps.build.outputs.testplan }}' + steps: + - name: 'Build testplan' + id: build + run: | + # Build testplan + # shellcheck disable=SC2088 # Tilde expansion happens in the workflow and not by bash + case '${{inputs.limit}}' in + "no") LIMIT='';; + "PHP8.1/MySQL5.7") LIMIT='~/defaults/php8.1_mysql5.7_only.yaml,' ;; + "PHP8.1/MySQL8.0") LIMIT='~/defaults/php8.1_mysql8.0_only.yaml,' ;; + "PHP8.2/MySQL5.7") LIMIT='~/defaults/php8.2_mysql5.7_only.yaml,' ;; + "PHP8.2/MySQL8.0") LIMIT='~/defaults/php8.2_mysql8.0_only.yaml,' ;; + *) echo "Illegal choice, fix the workflow" + exit 1 + ;; + esac + # shellcheck disable=SC2088 + TESTPLAN="~/defaults/7.1.x.yaml,${LIMIT}~/module-usercentrics.yaml" + echo "testplan=${TESTPLAN}" | tee -a "${GITHUB_OUTPUT}" + + dispatch_stable: + if: ${{ inputs.use_dev_version == 'no' }} + needs: build_testplan uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4 with: - testplan: '~/defaults/7.1.x.yml,~/module-usercentrics.yaml' + testplan: ${{ needs.build_testplan.outputs.testplan }} runs_on: '"ubuntu-latest"' defaults: 'v4' plan_folder: '.github/oxid-esales' + secrets: + DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} + DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} + CACHE_ENDPOINT: ${{ secrets.CACHE_ENDPOINT }} + CACHE_ACCESS_KEY: ${{ secrets.CACHE_ACCESS_KEY }} + CACHE_SECRET_KEY: ${{ secrets.CACHE_SECRET_KEY }} + enterprise_github_token: ${{ secrets.enterprise_github_token }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + dispatch_v0: + if: ${{ inputs.use_dev_version == 'v0' }} + needs: build_testplan + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v0 + with: + testplan: ${{ needs.build_testplan.outputs.testplan }} + runs_on: '"ubuntu-latest"' + defaults: 'v0' + plan_folder: '.github/oxid-esales' secrets: DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} diff --git a/.github/workflows/schedule_module.yaml b/.github/workflows/schedule.yaml similarity index 73% rename from .github/workflows/schedule_module.yaml rename to .github/workflows/schedule.yaml index eaafa08..f529105 100644 --- a/.github/workflows/schedule_module.yaml +++ b/.github/workflows/schedule.yaml @@ -5,12 +5,13 @@ on: - cron: '0 4 */7 * *' jobs: - call_matrix: - uses: OXID-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4 + usercentrics_71x_nightly: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4 with: - testplan: 'tests/github_actions/defaults/7.1.x.yaml,tests/github_actions/module-usercentrics.yaml' + testplan: '~/defaults/7.1.x.yaml,~/defaults/scheduled.yaml,~/module-usercentrics.yaml' runs_on: '"ubuntu-latest"' defaults: 'v4' + plan_folder: '.github/oxid-esales' secrets: DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} diff --git a/.github/workflows/trigger.yaml b/.github/workflows/trigger.yaml index 7d9f983..dc56d8a 100644 --- a/.github/workflows/trigger.yaml +++ b/.github/workflows/trigger.yaml @@ -1,4 +1,5 @@ -name: Automatically triggered on pull request +name: Auto trigger on push or pull requests +# Matrix workflow using re-usable github actions on: pull_request: {} @@ -7,10 +8,10 @@ on: - 'b-7.1.x*' jobs: - pull_module: + usercentrics_php82_mysql_80: uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4 with: - testplan: '~/defaults/7.1.x.yml,~/module-usercentrics.yaml' + testplan: '~/defaults/7.1.x.yaml,~/module-usercentrics.yaml' runs_on: '"ubuntu-latest"' defaults: 'v4' plan_folder: '.github/oxid-esales' @@ -22,4 +23,4 @@ jobs: CACHE_SECRET_KEY: ${{ secrets.CACHE_SECRET_KEY }} enterprise_github_token: ${{ secrets.enterprise_github_token }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}