Skip to content

Commit

Permalink
WIP Use workflow v4
Browse files Browse the repository at this point in the history
  • Loading branch information
angel-dimitrov committed Aug 20, 2024
1 parent 61903fe commit 01dc7b2
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
# {{ $ids:= "oxps_usercentrics" }}
# {{ $org := "oxid-professional-services" }}
# {{ $name := "usercentrics" }}
# {{ $order := "01" }}
prepare_shop:
matrix: &matrix
php: &matrix_php '["8.1", "8.2"]'
mysql: &matrix_mysql '["8.0"]'
specific: &specific_matrix
php: '["8.1"]'
mysql: '["8.0"]'
# matrix: &matrix
# php: &matrix_php '["8.1", "8.2"]'
# mysql: &matrix_mysql '["8.0"]'
# specific: &specific_matrix
# php: '["8.1"]'
# mysql: '["8.0"]'
git:
shop_ref: '{{ .Data.global.git.default_ref }}'

install_shop:
matrix: *matrix

install_module:
matrix:
<<: *matrix
testplan: '["-"]'
title: '{{ print $name }}-{{ print $order }}'
cache:
prefix: &install_module_prefix 'moduleInstallation-ce-{{ .Github.SHA }}-{{ .Github.RunNumber }}-{{ .Github.RunAttempt }}'
ids: &ids 'oxps_usercentrics'
ids: &ids '{{ print $ids }}'
activate: *ids
git:
module:
url: &git_module_url '{{ .Github.Repository }}'
ref: '{{ .Github.RefName }}'
package_name: &package_name 'oxid-professional-services/usercentrics'
package_name: &package_name '{{ print $org }}/{{ print $name }}'
path: *ids

phpunit:
matrix:
<<: *matrix
testplan: '["tests/github_actions/defaults/module_phpunit_unit.yml","tests/github_actions/defaults/module_phpunit_integration.yml"]'
testplan: '["~/defaults/module_phpunit_unit.yml","~/defaults/module_phpunit_integration.yml"]'
load_shop: *install_module_prefix

codeception:
matrix:
<<: *matrix
testplan: '["-"]'
load_shop: *install_module_prefix
title: codeception
title: 'codeception'
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'
Expand All @@ -57,9 +56,8 @@ runtest:

sonarcloud:
matrix:
<<: *specific_matrix
testplan: '["-"]'
project_key: 'OXID-eSales_usercentrics'
project_key: '{{ print $name }}-{{ print $order }}'
project_name: *package_name
parameters: |
-Dsonar.language=php
Expand All @@ -72,11 +70,10 @@ phpcs_tests:

styles:
matrix:
<<: *specific_matrix
testplan: '["-"]'
load_shop: *install_module_prefix
path: *ids
module_ids: *ids

finish:
slack_title: 'Module oxps_usercentrics on {{ .Github.Repository }} by {{ .Github.Actor }}'
slack_title: 'Module {{ print $name }} {{ .Github.RefName}} on {{ .Github.Repository }} by {{ .Github.Actor }}'
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
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.yml'
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'
Expand All @@ -16,7 +16,7 @@ on:

jobs:
call_matrix:
uses: OXID-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v0
uses: OXID-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v0
with:
testplan: ${{ inputs.testplan }}
runs_on: ${{ inputs.runs_on }}
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/dispatch_module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Manual stable trigger

on:
workflow_dispatch:
inputs:
inputs:
scenario:

Check failure on line 7 in .github/workflows/dispatch_module.yaml

View workflow job for this annotation

GitHub Actions / pull_module / actionlint

unexpected key "scenario" for "inputs" section. expected one of "default", "description", "required"
type: choice
options:
- 7.1.x
- use custom testplan
default: '7.1.x'
description: 'Choose test scenario'
limit:

Check failure on line 14 in .github/workflows/dispatch_module.yaml

View workflow job for this annotation

GitHub Actions / pull_module / actionlint

unexpected key "limit" for "inputs" section. expected one of "default", "description", "required"
type: choice
options:
- 'no'
- 'PHP8.1/MySQL5.7'
- 'PHP8.1/MySQL8.0'
- 'PHP8.2/MySQL5.7'
- 'PHP8.2/MySQL8.0'
default: 'PHP8.1/MySQL5.7'
description: 'Limit to one PHP/MySQL combination'
custom_testplan:

Check failure on line 24 in .github/workflows/dispatch_module.yaml

View workflow job for this annotation

GitHub Actions / pull_module / actionlint

unexpected key "custom_testplan" for "inputs" section. expected one of "default", "description", "required"
type: string
required: true
description: 'URL/PATH of the testplan to run'
default: '~/defaults/7.1.x.yaml,~/module-usercentrics.yaml'

jobs:
pull_module:
uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4
with:
testplan: '~/defaults/7.1.x.yml,~/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 }}
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 }}

pull_module_ee:
runs-on: ubuntu-latest
steps:
- name: Trigger EE workflow and wait for results
uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
owner: oxid-esales
repo: module-workflows
github_user: ${{ secrets.CI_USER }}
github_token: ${{ secrets.GH_CI_JENKINS_TOKEN }}
workflow_file_name: evat_workflow.yaml
ref: "b-7.1.x"
client_payload: "{\"php\": \"8.2\", \"mysql\": \"8.0\", \"edition\": \"ee\", \"ref\": \"${{ github.ref_name }}\"}"
32 changes: 0 additions & 32 deletions .github/workflows/dispatch_module.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/pull_module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Automatically triggered on pull request

on: pull_request

jobs:
pull_module:
uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4
with:
testplan: '~/defaults/7.1.x.yml,~/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 }}
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 }}

pull_module_ee:
runs-on: ubuntu-latest
steps:
- name: Trigger EE workflow and wait for results
uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
owner: oxid-esales
repo: module-workflows
github_user: ${{ secrets.CI_USER }}
github_token: ${{ secrets.GH_CI_JENKINS_TOKEN }}
workflow_file_name: evat_workflow.yaml
ref: "b-7.1.x"
client_payload: "{\"php\": \"8.2\", \"mysql\": \"8.0\", \"edition\": \"ee\", \"ref\": \"${{ github.ref_name }}\"}"
20 changes: 0 additions & 20 deletions .github/workflows/pull_module.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/push_module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Automatically triggered on push

on:
push:
branches:
- 'b-7.1.x*'

jobs:
pull_module:
uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4
with:
testplan: '~/defaults/7.1.x.yml,~/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 }}
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 }}

pull_module_ee:
runs-on: ubuntu-latest
steps:
- name: Trigger EE workflow and wait for results
uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
owner: oxid-esales
repo: module-workflows
github_user: ${{ secrets.CI_USER }}
github_token: ${{ secrets.GH_CI_JENKINS_TOKEN }}
workflow_file_name: evat_workflow.yaml
ref: "b-7.1.x"
client_payload: "{\"php\": \"8.2\", \"mysql\": \"8.0\", \"edition\": \"ee\", \"ref\": \"${{ github.ref_name }}\"}"
23 changes: 0 additions & 23 deletions .github/workflows/push_module.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:

jobs:
call_matrix:
uses: OXID-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v3
uses: OXID-eSales/github-actions/.github/workflows/call-universal_test_workflow.yaml@v4
with:
testplan: 'tests/github_actions/defaults/7.1.x.yml,tests/github_actions/module-usercentrics.yml'
testplan: 'tests/github_actions/defaults/7.1.x.yaml,tests/github_actions/module-usercentrics.yaml'
runs_on: '"ubuntu-latest"'
defaults: 'v3'
defaults: 'v4'
secrets:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
Expand Down

0 comments on commit 01dc7b2

Please sign in to comment.