|
1 |
| -name: Manual trigger for testing github actions development |
| 1 | +name: Manual run |
2 | 2 | # Matrix workflow using re-usable github actions
|
3 | 3 |
|
4 | 4 | on:
|
5 | 5 | workflow_dispatch:
|
6 | 6 | inputs:
|
7 |
| - testplan: |
| 7 | + scenario: |
| 8 | + type: choice |
| 9 | + options: |
| 10 | + - 7.0.x |
| 11 | + - 7.1.x |
| 12 | + - 7.2.x |
| 13 | + - 8.0.x |
| 14 | + - use custom testplan |
| 15 | + default: '8.0.x' |
| 16 | + description: 'Choose test scenario' |
| 17 | + limit: |
| 18 | + type: choice |
| 19 | + options: |
| 20 | + - 'no' |
| 21 | + - 'PHP8.0/MySQL5.7' |
| 22 | + - 'PHP8.0/MySQL8.0' |
| 23 | + - 'PHP8.1/MySQL5.7' |
| 24 | + - 'PHP8.1/MySQL8.0' |
| 25 | + - 'PHP8.2/MySQL5.7' |
| 26 | + - 'PHP8.2/MySQL8.0' |
| 27 | + - 'PHP8.3/MySQL5.7' |
| 28 | + - 'PHP8.3/MySQL8.0' |
| 29 | + description: |
| 30 | + default: 'PHP8.1/MySQL5.7' |
| 31 | + custom_testplan: |
8 | 32 | type: string
|
9 |
| - required: true |
10 |
| - description: 'URL/PATH of the testplan to run' |
11 |
| - default: 'tests/github_actions/defaults/defaults.yml,tests/github_actions/twig-component.yml' |
| 33 | + description: 'Custom testplan' |
| 34 | + default: '~/defaults/php8.2_mysql5.7_only.yaml,~/twig-component.yaml,~/defaults/component.yaml' |
12 | 35 | runs_on:
|
| 36 | + type: string |
13 | 37 | description: 'JSON string/array describing the runner'
|
14 |
| - required: true |
15 | 38 | default: '["self-hosted", "x64"]'
|
| 39 | + use_dev_version: |
| 40 | + type: choice |
| 41 | + options: ['no', 'v0'] |
| 42 | + description: 'Use the dev version of github actions' |
| 43 | + default: 'no' |
16 | 44 |
|
17 | 45 | jobs:
|
18 |
| - call_matrix: |
19 |
| - uses: oxid-eSales/github-actions/.github/workflows/call-universal_test_workflow.yml@v0 |
| 46 | + build_testplan: |
| 47 | + runs-on: ${{ fromJson(inputs.runs_on) }} |
| 48 | + outputs: |
| 49 | + testplan: '${{ steps.build.outputs.testplan }}' |
| 50 | + steps: |
| 51 | + - name: 'Build testplan' |
| 52 | + id: build |
| 53 | + run: | |
| 54 | + # Build testplan |
| 55 | + # shellcheck disable=SC2088 |
| 56 | + PLAN="~/twig-component-ee.yaml,~/defaults/component.yaml" |
| 57 | + # shellcheck disable=SC2088 |
| 58 | + case "${{ inputs.limit }}" in |
| 59 | + "no") LIMIT='';; |
| 60 | + "PHP8.0/MySQL5.7") LIMIT='~/defaults/php8.0_mysql5.7_only.yaml,' ;; |
| 61 | + "PHP8.0/MySQL8.0") LIMIT='~/defaults/php8.0_mysql8.0_only.yaml,' ;; |
| 62 | + "PHP8.1/MySQL5.7") LIMIT='~/defaults/php8.1_mysql5.7_only.yaml,' ;; |
| 63 | + "PHP8.1/MySQL8.0") LIMIT='~/defaults/php8.1_mysql8.0_only.yaml,' ;; |
| 64 | + "PHP8.2/MySQL5.7") LIMIT='~/defaults/php8.2_mysql5.7_only.yaml,' ;; |
| 65 | + "PHP8.2/MySQL8.0") LIMIT='~/defaults/php8.2_mysql8.0_only.yaml,' ;; |
| 66 | + "PHP8.3/MySQL5.7") LIMIT='~/defaults/php8.3_mysql5.7_only.yaml,' ;; |
| 67 | + "PHP8.3/MySQL8.0") LIMIT='~/defaults/php8.3_mysql8.0_only.yaml,' ;; |
| 68 | + *) echo "Illegal choice, fix the workflow" |
| 69 | + exit 1 |
| 70 | + ;; |
| 71 | + esac |
| 72 | + # shellcheck disable=SC2088 |
| 73 | + case '${{ inputs.scenario}}' in |
| 74 | + "7.0.x") TESTPLAN="~/defaults/7.0.x.yaml,${LIMIT}${PLAN}" ;; |
| 75 | + "7.1.x") TESTPLAN="~/defaults/7.1.x.yaml,${LIMIT}${PLAN}" ;; |
| 76 | + "7.2.x") TESTPLAN="~/defaults/7.2.x.yaml,${LIMIT}${PLAN}" ;; |
| 77 | + "8.0.x") TESTPLAN="${LIMIT}${PLAN}" ;; |
| 78 | + "smarty 7.0.x") TESTPLAN="~/defaults/7.0.x.yaml,${LIMIT}~/smarty_7.0.x.yaml" ;; |
| 79 | + "use custom testplan") TESTPLAN="${{ inputs.custom_testplan }}" ;; |
| 80 | + *) |
| 81 | + echo "Illegal choice, fix the workflow" |
| 82 | + exit 1 |
| 83 | + ;; |
| 84 | + esac |
| 85 | + echo "testplan=${TESTPLAN}" | tee -a "${GITHUB_OUTPUT}" |
| 86 | +
|
| 87 | + dispatch_stable: |
| 88 | + if: ${{ inputs.use_dev_version == 'no' }} |
| 89 | + needs: build_testplan |
| 90 | + uses: oxid-eSales/github-actions/.github/workflows/universal_workflow_light.yaml@v4 |
| 91 | + with: |
| 92 | + testplan: ${{ needs.build_testplan.outputs.testplan }} |
| 93 | + runs_on: ${{ inputs.runs_on }} |
| 94 | + defaults: 'v0' |
| 95 | + plan_folder: '.github/oxid-esales' |
| 96 | + secrets: |
| 97 | + DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} |
| 98 | + DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} |
| 99 | + CACHE_ENDPOINT: ${{ secrets.CACHE_ENDPOINT }} |
| 100 | + CACHE_ACCESS_KEY: ${{ secrets.CACHE_ACCESS_KEY }} |
| 101 | + CACHE_SECRET_KEY: ${{ secrets.CACHE_SECRET_KEY }} |
| 102 | + enterprise_github_token: ${{ secrets.enterprise_github_token }} |
| 103 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 104 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 105 | + |
| 106 | + dispatch_v0: |
| 107 | + if: ${{ inputs.use_dev_version == 'v0' }} |
| 108 | + needs: build_testplan |
| 109 | + uses: oxid-eSales/github-actions/.github/workflows/universal_workflow_light.yaml@v0 |
20 | 110 | with:
|
21 |
| - testplan: ${{ inputs.testplan }} |
| 111 | + testplan: ${{ needs.build_testplan.outputs.testplan }} |
22 | 112 | runs_on: ${{ inputs.runs_on }}
|
23 |
| - defaults: 'v3' |
| 113 | + defaults: 'v0' |
| 114 | + plan_folder: '.github/oxid-esales' |
24 | 115 | secrets:
|
25 | 116 | DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
|
26 | 117 | DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
0 commit comments