Skip to content

Commit

Permalink
OXDEV-7614 Cleanup GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
RahatHameed committed Apr 26, 2024
1 parent c7be1ee commit 1167098
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 180 deletions.
64 changes: 64 additions & 0 deletions .github/oxid-esales/module-graphql-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# {{ $ids := "oe_graphql_base" }}ids: {{ print $ids }}
# {{ $org := "oxid-esales" }}organisation: {{ print $org }}
# {{ $name := "graphql-base" }}name: {{ print $name }}
# {{ $order := "01" }}order: {{ print $order }}
prepare_shop:
git:
shop_ref: '{{ .Data.global.git.default_ref }}'

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: '["~/defaults/module_phpunit_unit.yml","~/defaults/module_phpunit_integration.yml"]'
load_shop: *install_module_prefix

codeception:
matrix:
testplan: '["~/defaults/module_codeception_Acceptance_71x.yml"]'
title: '{{ print $name }}-{{ print $order }}'
load_shop: *install_module_prefix

runtest:
matrix:
testplan: 'skip'
title: '{{ print $name }}-{{ print $order }}'
load_shop: *install_module_prefix

sonarcloud:
matrix:
testplan: '["-"]'
title: '{{ print $name }}-{{ print $order }}'
project_key: 'OXID-eSales_graphql-base-module'
project_name: *package_name
parameters: |
-Dsonar.language=php
-Dsonar.scm.provider=git
-Dsonar.sources=src
-Dsonar.tests=tests
phpcs_tests:
skip: true

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 }}'
32 changes: 0 additions & 32 deletions .github/workflows/dispatch_dev_module.yml

This file was deleted.

82 changes: 54 additions & 28 deletions .github/workflows/dispatch_module.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,58 @@
name: Manual stable trigger
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-graphql-base.yml'
runs_on:
type: string
description: 'JSON string/array describing the runner'
required: true
default: '"ubuntu-latest"'
workflow_dispatch:
inputs:
limit:
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'

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 }}
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.yml,' ;;
"PHP8.1/MySQL8.0") LIMIT='~/defaults/php8.1_mysql8.0_only.yml,' ;;
"PHP8.2/MySQL5.7") LIMIT='~/defaults/php8.2_mysql5.7_only.yml,' ;;
"PHP8.2/MySQL8.0") LIMIT='~/defaults/php8.2_mysql8.0_only.yml,' ;;
*) echo "Illegal choice, fix the workflow"
exit 1
;;
esac
# shellcheck disable=SC2088
TESTPLAN="~/defaults/7.1.x.yml,${LIMIT}~/module-graphql-base.yml"
echo "testplan=${TESTPLAN}" | tee -a "${GITHUB_OUTPUT}"
dispatch_stable:
needs: build_testplan
uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v4
with:
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 }}
20 changes: 0 additions & 20 deletions .github/workflows/pull_module.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/schedule_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ 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.yml@v4
with:
testplan: 'tests/github_actions/defaults/7.1.x.yml,tests/github_actions/module-graphql-base.yml'
testplan: '~/defaults/7.1.x.yml,~/module-graphql-base.yml'
runs_on: '"ubuntu-latest"'
defaults: 'v3'
defaults: 'v4'
plan_folder: '.github/oxid-esales'
secrets:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Automatically triggered on push
name: Auto trigger on push or pull requests

on:
push:
branches:
- 'b-7.1.x*'
pull_request: {}
push: {}

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.yml@v4
with:
testplan: 'tests/github_actions/defaults/7.1.x.yml,tests/github_actions/module-graphql-base.yml'
testplan: '~/defaults/7.1.x.yml,~/defaults/php8.2_mysql8.0_only.yml,~/module-graphql-base.yml'
runs_on: '"ubuntu-latest"'
defaults: 'v3'
defaults: 'v4'
plan_folder: '.github/oxid-esales'
secrets:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
Expand Down
90 changes: 0 additions & 90 deletions tests/github_actions/module-graphql-base.yml

This file was deleted.

0 comments on commit 1167098

Please sign in to comment.