diff --git a/.github/workflows/dispatch_dev_module.yml b/.github/workflows/dispatch_dev_module.yml new file mode 100644 index 0000000..28bd11c --- /dev/null +++ b/.github/workflows/dispatch_dev_module.yml @@ -0,0 +1,32 @@ +name: Manual trigger for testing github actions development +# Matrix workflow using re-usable github actions + +on: + workflow_dispatch: + inputs: + testplan: + type: string + required: true + description: 'URL/PATH of the testplan to run' + default: 'tests/github_actions/defaults/7.0.x.yml,tests/github_actions/twig-component.yml' + runs_on: + description: 'JSON string/array describing the runner' + required: true + default: '["self-hosted", "x64"]' + +jobs: + call_matrix: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v0 + with: + testplan: ${{ inputs.testplan }} + runs_on: ${{ inputs.runs_on }} + defaults: 'v3' + 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.yml b/.github/workflows/dispatch_module.yml new file mode 100644 index 0000000..62f281e --- /dev/null +++ b/.github/workflows/dispatch_module.yml @@ -0,0 +1,33 @@ +name: Manual stable trigger +# Matrix workflow using re-usable github actions + +on: + workflow_dispatch: + inputs: + testplan: + type: string + required: true + description: 'URL/PATH of the testplan to run' + default: 'tests/github_actions/defaults/7.0.x.yml,tests/github_actions/twig-component.yml' + runs_on: + type: string + description: 'JSON string/array describing the runner' + required: true + default: '["self-hosted", "x64"]' + +jobs: + call_matrix: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: ${{ inputs.testplan }} + runs_on: ${{ inputs.runs_on }} + defaults: 'v3' + 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/pull_module_7.0x.yml b/.github/workflows/pull_module_7.0x.yml new file mode 100644 index 0000000..40f6833 --- /dev/null +++ b/.github/workflows/pull_module_7.0x.yml @@ -0,0 +1,23 @@ +name: Automatically triggered on pull request to the 7.0.x branch + +on: + pull_request: + branches: + - 'b-7.0.x**' + +jobs: + pull_module: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: 'tests/github_actions/defaults/7.0.x.yml,tests/github_actions/twig-component.yml' + runs_on: '["self-hosted", "x64"]' + defaults: 'v3' + 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/pull_module_7.1x.yml b/.github/workflows/pull_module_7.1x.yml new file mode 100644 index 0000000..bc660b7 --- /dev/null +++ b/.github/workflows/pull_module_7.1x.yml @@ -0,0 +1,23 @@ +name: Automatically triggered on pull request to the 7.1.x branch + +on: + pull_request: + branches: + - 'b-7.1.x**' + +jobs: + pull_module: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: 'tests/github_actions/defaults/7.0.x.yml,tests/github_actions/twig-component.yml' + runs_on: '["self-hosted", "x64"]' + defaults: 'v3' + 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/pull_module_8.0x.yml b/.github/workflows/pull_module_8.0x.yml new file mode 100644 index 0000000..36236f1 --- /dev/null +++ b/.github/workflows/pull_module_8.0x.yml @@ -0,0 +1,23 @@ +name: Automatically triggered on pull request to the 8.0.x branch + +on: + pull_request: + branches: + - 'b-8.0.x**' + +jobs: + pull_module: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: 'tests/github_actions/twig-component.yml' + runs_on: '["self-hosted", "x64"]' + defaults: 'v3' + 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/push_module_7.0x.yml b/.github/workflows/push_module_7.0x.yml new file mode 100644 index 0000000..eae7676 --- /dev/null +++ b/.github/workflows/push_module_7.0x.yml @@ -0,0 +1,23 @@ +name: Automatically triggered on push to 7.0.x + +on: + push: + branches: + - 'b-7.0.x**' + +jobs: + push_module: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: 'tests/github_actions/twig-component.yml' + runs_on: '["self-hosted", "x64"]' + defaults: 'v3' + 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/push_module_7.1x.yml b/.github/workflows/push_module_7.1x.yml new file mode 100644 index 0000000..b9ba4f3 --- /dev/null +++ b/.github/workflows/push_module_7.1x.yml @@ -0,0 +1,23 @@ +name: Automatically triggered on push to 7.1.x + +on: + push: + branches: + - 'b-7.1.x**' + +jobs: + push_module: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: 'tests/github_actions/twig-component.yml' + runs_on: '["self-hosted", "x64"]' + defaults: 'v3' + 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/push_module_8.0x.yml b/.github/workflows/push_module_8.0x.yml new file mode 100644 index 0000000..73c2f9d --- /dev/null +++ b/.github/workflows/push_module_8.0x.yml @@ -0,0 +1,23 @@ +name: Automatically triggered on push to 8.0.x + +on: + push: + branches: + - 'b-8.0.x**' + +jobs: + push_module: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: 'tests/github_actions/twig-component.yml' + runs_on: '["self-hosted", "x64"]' + defaults: 'v3' + 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/schedule.yml b/.github/workflows/schedule.yml new file mode 100644 index 0000000..26e222c --- /dev/null +++ b/.github/workflows/schedule.yml @@ -0,0 +1,22 @@ +name: schedule + +on: + schedule: + - cron: '47 2 */7 * *' + +jobs: + call_matrix: + uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3 + with: + testplan: 'tests/github_actions/defaults/php8.2_mysql8.0_only.yml,tests/github_actions/defaults/ee.yml,tests/github_actions/twig-component.yml' + runs_on: '["self-hosted", "x64"]' + defaults: 'v3' + 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/tests/github_actions/twig-component.yml b/tests/github_actions/twig-component.yml new file mode 100644 index 0000000..45314de --- /dev/null +++ b/tests/github_actions/twig-component.yml @@ -0,0 +1,40 @@ +# {{ $ids := "twig-component" }}ids: {{ print $ids }} +# {{ $org := "oxid-esales" }}organisation: {{ print $org }} +# {{ $name := "twig-component" }}name: {{ print $name }} +install_module: + matrix: + testplan: '["-"]' + cache: + prefix: &install_module_prefix 'moduleInstallation-ce-{{ .Github.SHA }}-{{ .Github.RunID }}' + ids: &ids '{{ print $ids }}' + activate: *ids + git: + module: + url: &git_module_url '{{ .Github.Repository }}' + ref: '{{ .Github.RefName }}' + package_name: &package_name '{{ print $org }}/{{ print $name }}' + path: *ids + +phpunit: + matrix: + testplan: '["tests/github_actions/defaults/module_phpunit_unit.yml","tests/github_actions/defaults/module_phpunit_integration.yml"]' + load_shop: *install_module_prefix + +runtest: + matrix: + testplan: 'skip' + load_shop: *install_module_prefix + +sonarcloud: + matrix: + testplan: '["-"]' + +styles: + matrix: + testplan: '["-"]' + load_shop: *install_module_prefix + path: *ids + module_ids: *ids + +finish: + slack_title: 'Module {{ print $name }} ({{ .Data.global.git.shop_ref }}) on {{ .Github.Repository }} by {{ .Github.Actor }}' \ No newline at end of file