-
Notifications
You must be signed in to change notification settings - Fork 17
137 lines (134 loc) · 4.92 KB
/
dispatch_metapackage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Manual trigger
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
inputs:
version:
type: choice
options:
- '7.0'
- '7.1'
- '7.2'
- '8.0'
- 'custom'
default: '8.0'
description: 'Version of the metapackage'
scenario:
type: choice
options:
- 'full'
- 'slim'
- 'superslim'
default: 'superslim'
description: 'Scenario'
limit:
type: choice
options:
- 'no'
- 'PHP8.0/MySQL5.7'
- 'PHP8.0/MySQL8.0'
- 'PHP8.1/MySQL5.7'
- 'PHP8.1/MySQL8.0'
- 'PHP8.2/MySQL5.7'
- 'PHP8.2/MySQL8.0'
- 'PHP8.2/MariaDb11'
- 'PHP8.3/MySQL5.7'
- 'PHP8.3/MySQL8.0'
- 'PHP8.3/MariaDb11'
default: 'PHP8.1/MySQL5.7'
description: 'Limit to one PHP/MySQL combination'
custom_testplan:
type: string
required: true
description: 'Custom testplan'
default: '~/defaults/php8.2_mysql5.7_only.yaml,~/metapackage-8.0-full.yaml'
runs_on:
type: string
description: 'JSON string/array describing the runner'
required: true
default: '["ubuntu-latest"]'
use_dev_version:
type: choice
options: ['no', 'v0']
description: 'Use the dev version of github actions'
default: 'no'
jobs:
build_testplan:
runs-on: ${{ fromJson(inputs.runs_on) }}
outputs:
testplan: '${{ steps.build.outputs.testplan }}'
steps:
- name: 'Build matrix'
id: build
run: |
# Build matrix
# shellcheck disable=SC2088
case "${{ inputs.limit }}" in
"no") LIMIT='';;
"PHP8.0/MySQL5.7") LIMIT='~/defaults/php8.0_mysql5.7_only.yaml,' ;;
"PHP8.0/MySQL8.0") LIMIT='~/defaults/php8.0_mysql8.0_only.yaml,' ;;
"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,' ;;
"PHP8.2/MariaDb11") LIMIT='~/defaults/php8.2_mariadb11_only.yaml,' ;;
"PHP8.3/MySQL5.7") LIMIT='~/defaults/php8.3_mysql5.7_only.yaml,' ;;
"PHP8.3/MySQL8.0") LIMIT='~/defaults/php8.3_mysql8.0_only.yaml,' ;;
"PHP8.3/MariaDb11") LIMIT='~/defaults/php8.3_mariadb11_only.yaml,' ;;
*) echo "Illegal choice, fix the workflow"
exit 1
;;
esac
# shellcheck disable=SC2088
case '${{ inputs.version}}' in
"7.0") PRE="~/defaults/7.0.x.yaml," ;;
"7.1") PRE="~/defaults/7.1.x.yaml," ;;
"7.2") PRE="~/defaults/7.2.x.yaml," ;;
"8.0") PRE="~/defaults/8.0.x.yaml," ;;
custom) TESTPLAN="${{ inputs.custom_testplan }}" ;;
*)
echo "Illegal choice, fix the workflow"
exit 1
;;
esac
if [ -z "${TESTPLAN}" ]; then
# shellcheck disable=SC2088
TESTPLAN="${PRE}${LIMIT}~/metapackage-${{inputs.version}}-${{inputs.scenario}}.yaml"
fi
echo "testplan=${TESTPLAN}" | tee -a "${GITHUB_OUTPUT}"
stable:
needs: build_testplan
if: ${{ inputs.use_dev_version == 'no' }}
uses: oxid-eSales/github-actions/.github/workflows/universal_workflow_light.yaml@v4
with:
testplan: ${{ needs.build_testplan.outputs.testplan }}
runs_on: ${{ inputs.runs_on }}
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 }}
dev:
needs: build_testplan
if: ${{ inputs.use_dev_version == 'v0' }}
uses: oxid-eSales/github-actions/.github/workflows/universal_workflow_light.yaml@v0
with:
testplan: ${{ needs.build_testplan.outputs.testplan }}
runs_on: ${{ inputs.runs_on }}
defaults: 'v0'
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 }}