Skip to content

Commit

Permalink
Add workflows in .github/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
snehasreeramini committed Feb 6, 2024
1 parent cd99aeb commit f87e0fd
Show file tree
Hide file tree
Showing 10 changed files with 265 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/dispatch_dev_module.yml
Original file line number Diff line number Diff line change
@@ -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 }}
33 changes: 33 additions & 0 deletions .github/workflows/dispatch_module.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions .github/workflows/pull_module_7.0x.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions .github/workflows/pull_module_7.1x.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions .github/workflows/pull_module_8.0x.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions .github/workflows/push_module_7.0x.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions .github/workflows/push_module_7.1x.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions .github/workflows/push_module_8.0x.yml
Original file line number Diff line number Diff line change
@@ -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 }}
22 changes: 22 additions & 0 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -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 }}
40 changes: 40 additions & 0 deletions tests/github_actions/twig-component.yml
Original file line number Diff line number Diff line change
@@ -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 }}'

0 comments on commit f87e0fd

Please sign in to comment.