Skip to content

Commit

Permalink
OXDEV-8573 Add GhA v0 dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaIvanovski committed Sep 4, 2024
1 parent 05724e0 commit 4cbfe17
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 60 deletions.
13 changes: 8 additions & 5 deletions .github/oxid-esales/module-usercentrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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 }}'
slack_title: 'Module {{ print $name }} ({{ .Github.RefName }}) on {{ .Github.Repository }} by {{ .Github.Actor }}'
32 changes: 0 additions & 32 deletions .github/workflows/dispatch_dev_module.yaml

This file was deleted.

71 changes: 55 additions & 16 deletions .github/workflows/dispatch_module.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/trigger.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
Expand All @@ -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'
Expand All @@ -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 }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit 4cbfe17

Please sign in to comment.