-
Notifications
You must be signed in to change notification settings - Fork 0
1357 lines (1278 loc) · 60.4 KB
/
universal_workflow_light.yml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: universal_workflow_light
# This workflow loads a base testplan, creates cached shop instances and runs
# phpunit, codeception and runtest based tests as well as code scans
# and sonarcloud reports
#
# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
testplan:
type: string
description: 'Testplan to run'
required: true
runs_on:
type: string
description: 'JSON string/array describing the runner'
required: true
defaults:
type: string
description: 'Which ref do we want to use for the plan defaults'
required: false
default: 'v3'
plan_folder:
type: string
description: 'Folder containing the test plans'
required: false
default: 'tests/github_actions'
default_plan_folder:
type: string
description: 'Folder containing the test plan templates'
required: false
default: '.github/oxid-esales/defaults'
debug:
type: boolean
description: 'Enable debugging'
default: true
required: false
custom_testplan_yaml:
type: string
description: 'Content of ~/oxid-esales/_custom.yaml'
default: ''
required: false
use_scheduled_slack_channel:
type: boolean
description: 'Use alternative slack channel'
default: false
required: false
secrets:
DOCKER_HUB_USER:
# description: 'user for the docker login'
required: false
DOCKER_HUB_TOKEN:
# description: 'Token for the docker login'
required: false
CACHE_ENDPOINT:
# description: 'Endpoint for tespkg/actions-cache@v1'
required: false # only for ee
CACHE_ACCESS_KEY:
# description: 'Access key for tespkg/actions-cache@v1'
required: false # only for ee
CACHE_SECRET_KEY:
# description: 'Secret key for tespkg/actions-cache@v1'
required: false # only for ee
enterprise_github_token:
# description: 'OAuth token to access enterprise repos'
required: false
SONAR_TOKEN:
# description: Token for sonarcloud access
required: false
SLACK_WEBHOOK_URL:
required: false
# description: Webhook for posting to SLACK
SLACK_SCHEDULED_WEBHOOK_URL:
required: false
# description: Webhook for posting to SLACK
jobs:
init:
runs-on: ${{ fromJSON(inputs.runs_on) }}
steps:
- name: 'Checkout testplan defaults'
uses: actions/checkout@v4
with:
repository: 'OXID-eSales/github-actions'
ref: '${{ inputs.defaults }}'
path: 'defaults'
sparse-checkout: '${{ inputs.default_plan_folder }}'
- name: 'Checkout testplans'
uses: actions/checkout@v4
with:
sparse-checkout: |
${{ inputs.plan_folder}}
composer.json
path: workflow
- name: 'Consolidate plans'
id: consolidate_plans
run: |
mkdir -p '${{ inputs.plan_folder }}/defaults'
if [ -d workflow/${{ inputs.plan_folder }} ]; then
mv workflow/${{ inputs.plan_folder }}/* '${{ inputs.plan_folder }}/'
/bin/rm -r 'workflow/${{ inputs.plan_folder }}'
fi
if [ -f workflow/composer.json ]; then
mv workflow/composer.json '${{ inputs.plan_folder }}/'
fi
mv defaults/${{ inputs.default_plan_folder}}/* '${{ inputs.plan_folder }}/defaults/'
cat >'${{ inputs.plan_folder }}/_custom.yaml' <<'EOF'
# Generated from workflow input custom_testplan_yaml
${{ inputs.custom_testplan_yaml }}
EOF
# ToDo: The next line can be removed in v5 when the transition to yaml is finished
cp '${{ inputs.plan_folder }}/_custom.yaml' '${{ inputs.plan_folder }}/_custom.yml'
if [ '${{ github.event_name }}' == 'pull_request' ]; then
REF=$(echo '{{ .Github.HeadRef }}'|sed -e 's|/refs/heads/||')
# This is the git ref name
sed -e "s|safe_ref_name:.*|safe_ref_name: ${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
# This is the same for composer but with an added dev- prefix
sed -e "s|ref_name: dev-.*|ref_name: dev-${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
fi
TESTPLAN=$(echo "${{ inputs.testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g')
# ToDo: Remove the ,${{ inputs.plan_folder }}/defaults/_rename.yaml when releasing v5
DEFAULTS="${{ inputs.plan_folder }}/defaults/defaults_light.yaml"
echo "testplan=${DEFAULTS},${TESTPLAN},${{ inputs.plan_folder }}/defaults/_rename.yaml" >>"${GITHUB_OUTPUT}"
- name: 'Load Testplan'
id: ltp
uses: 'joernott/load_testplan@v1'
with:
files: '${{ steps.consolidate_plans.outputs.testplan }}'
set_output: true
set_env: true
set_print: true
loglevel: info
logfile: load_testplan_init.log
yaml: generated_testplan.yaml
- name: 'Prepare artifact and generate safe title'
id: post_ltp
if: always()
run: |
cp "${GITHUB_OUTPUT}" generated_output.txt
cp "${GITHUB_ENV}" generated_env.txt
echo 'title=${{steps.ltp.outputs.global_title}}'| \
sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \
sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \
tee -a "${GITHUB_OUTPUT}"
- name: Cache testplan on S3
if: ${{ inputs.runs_on != '"ubuntu-latest"'}}
uses: tespkg/actions-cache/save@v1
with:
path: |
${{ inputs.plan_folder }}/*
key: '${{ steps.ltp.outputs.init_cache_name }}'
endpoint: ${{ secrets.CACHE_ENDPOINT }}
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
bucket: ${{ steps.ltp.outputs.init_cache_bucket }}
- name: Cache testplan on Github
if: ${{ inputs.runs_on == '"ubuntu-latest"'}}
uses: actions/cache/save@v4
with:
path: |
${{ inputs.plan_folder }}/*
key: '${{ steps.ltp.outputs.init_cache_name }}'
- name: Install missing python3-yaml on private runners
if: ${{ inputs.runs_on != '"ubuntu-latest"'}}
shell: bash
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update
sudo apt-get -qq install python3-yaml
- name: Obfuscate _custom yaml
if: always()
shell: python
run: |
import yaml
def obfuscate(d):
for k, v in d.items():
if isinstance(v, dict):
obfuscate(v)
else:
d[k]='***'
return d
with open('${{ inputs.plan_folder }}/_custom.yaml','r') as f:
data = yaml.safe_load(f)
if isinstance(data, dict):
if 'secrets' in data:
data['secrets']=obfuscate(data['secrets'])
with open('${{ inputs.plan_folder }}/_custom.yaml', 'w') as file:
yaml.dump(data, file)
with open('${{ inputs.plan_folder }}/_custom.yml', 'w') as file:
yaml.dump(data, file)
- name: 'Create first testplan archive'
if: always()
id: begin_report
uses: OXID-eSales/github-actions/begin_report@v4
with:
title: ${{ steps.ltp.outputs.finish_slack_title }}
prefix: '${{ steps.post_ltp.outputs.title }}'
repository: '${{ github.server_url }}/${{ github.repository }}'
job: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
testplan: '${{ inputs.testplan }}'
files: |
${{ inputs.plan_folder}}/*
generated_testplan.yaml
generated_output.txt
generated_env.txt
load_testplan_init.log
debug: ${{ inputs.debug }}
- name: 'Write Report'
if: always()
uses: OXID-eSales/github-actions/append_report@v4
with:
prefix: '${{ steps.post_ltp.outputs.title }}'
header: true
phase: install
priority: '001'
cached_object: ${{ steps.ltp.outputs.init_cache_name }}
debug: false
github_token: ${{ secrets.enterprise_github_token || github.token }}
outputs:
debug: ${{ steps.begin_report.outputs.debug }}
use_private_cache: ${{ inputs.runs_on != '"ubuntu-latest"'}}
global_title: ${{ steps.post_ltp.outputs.title }}
# init variables
testplan: ${{ steps.consolidate_plans.outputs.testplan }}
init_cache_bucket: ${{ steps.ltp.outputs.init_cache_bucket }}
init_cache_name: ${{ steps.ltp.outputs.init_cache_name }}
# install variables
install_matrix_mysql: ${{ steps.ltp.outputs.install_matrix_mysql }}
install_matrix_php: ${{ steps.ltp.outputs.install_matrix_php }}
install_max_parallel: ${{ steps.ltp.outputs.install_max_parallel }}
# runscript variables
runscript_matrix_mysql: ${{ steps.ltp.outputs.runscript_matrix_mysql }}
runscript_matrix_php: ${{ steps.ltp.outputs.runscript_matrix_php }}
runscript_matrix_script: ${{ steps.ltp.outputs.runscript_matrix_script }}
runscript_max_parallel: ${{ steps.ltp.outputs.runscript_max_parallel }}
# runslim variables
runslim_matrix_mysql: ${{ steps.ltp.outputs.runslim_matrix_mysql }}
runslim_matrix_php: ${{ steps.ltp.outputs.runslim_matrix_php }}
runslim_matrix_script: ${{ steps.ltp.outputs.runslim_matrix_script }}
runslim_max_parallel: ${{ steps.ltp.outputs.runslim_max_parallel }}
# sonarcloud variables
sonarcloud_matrix_mysql: ${{ steps.ltp.outputs.sonarcloud_matrix_mysql }}
sonarcloud_matrix_php: ${{ steps.ltp.outputs.sonarcloud_matrix_php }}
sonarcloud_matrix_testplan: ${{ steps.ltp.outputs.sonarcloud_matrix_testplan }}
sonarcloud_max_parallel: ${{ steps.ltp.outputs.sonarcloud_max_parallel }}
# yamllint variables
yamllint_skip: ${{ steps.ltp.outputs.yamllint_skip }}
yamllint_file_or_dir: ${{ steps.ltp.outputs.yamllint_file_or_dir }}
yamllint_rules: ${{ steps.ltp.outputs.yamllint_rules }}
# actionlint variables
actionlint_skip: ${{ steps.ltp.outputs.actionlint_skip }}
# finish variables
finish_matrix_mysql: ${{ steps.ltp.outputs.finish_matrix_mysql }}
finish_matrix_php: ${{ steps.ltp.outputs.finish_matrix_php }}
finish_skip: ${{ steps.ltp.outputs.finish_skip }}
finish_slack_title: ${{ steps.ltp.outputs.finish_slack_title }}
finish_slack_compact: ${{ steps.ltp.outputs.finish_slack_compact }}
install:
needs: init
strategy:
matrix:
php: ${{ fromJSON(needs.init.outputs.install_matrix_php) }}
mysql: ${{ fromJSON(needs.init.outputs.install_matrix_mysql) }}
fail-fast: false
max-parallel: ${{ fromJSON(needs.init.outputs.install_max_parallel) }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
steps:
- name: Load cached testplan
id: itn
uses: OXID-eSales/github-actions/load_cached_testplan@v4
with:
php: ${{ matrix.php }}
mysql: ${{ matrix.mysql }}
prefix: '${{ needs.init.outputs.global_title }}'
root_testplan: ${{ needs.init.outputs.testplan }}
matrix_testplan: ''
plan_folder: ${{ inputs.plan_folder }}
cache_name: ${{ needs.init.outputs.init_cache_name }}
cache_endpoint: ${{ secrets.CACHE_ENDPOINT }}
cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }}
cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }}
cache_bucket: ${{ needs.init.outputs.init_cache_bucket }}
debug: ${{ needs.init.outputs.debug }}
- name: 'Load Testplan'
id: iltp
uses: 'joernott/load_testplan@v1'
with:
files: '${{steps.itn.outputs.testplan}}'
set_output: true
set_print: true
set_env: true
yaml: generated_testplan.yaml
loglevel: info
logfile: load_testplan_install.log
token: ${{ secrets.enterprise_github_token }}
- name: 'Prepare Shop'
id: prepare_shop
uses: 'OXID-eSales/github-actions/prepare_shop@v4'
with:
container_name: ${{ steps.iltp.outputs.install_container_name }}
container_options: ${{ steps.iltp.outputs.install_container_options }}
container_method: ${{ steps.iltp.outputs.install_container_method }}
docker_login: ${{ steps.iltp.outputs.install_docker_login }}
docker_user: ${{ secrets.DOCKER_HUB_USER }}
docker_token: ${{ secrets.DOCKER_HUB_TOKEN }}
# Deprecated, use git_sdk_repository instead. This will be removed in in v5
git_sdk_url: ${{ steps.iltp.outputs.install_git_sdk_url }}
git_sdk_repository: ${{ steps.iltp.outputs.install_git_sdk_repository }}
git_sdk_ref: ${{ steps.iltp.outputs.install_git_sdk_ref }}
# Deprecated, use git_repository instead. This will be removed in in v5
git_shop_url: ${{ steps.iltp.outputs.install_git_shop_url }}
# Deprecated, use git_ref instead. This will be removed in in v5
git_shop_ref: ${{ steps.iltp.outputs.install_git_shop_ref }}
git_repository: ${{ steps.iltp.outputs.install_git_repository }}
git_ref: ${{ steps.iltp.outputs.install_git_ref }}
compilation_url: ${{ steps.iltp.outputs.install_composer_root_url }}
github_ref_name: ${{ github.ref_name }}
php: ${{ matrix.php }}
mysql: ${{ matrix.mysql }}
custom_ini_error_reporting: ${{ steps.iltp.outputs.install_custom_ini_error_reporting }}
custom_ini_xdebug: ${{ steps.iltp.outputs.install_custom_ini_xdebug }}
add_services: ${{ steps.iltp.outputs.install_add_services }}
composer_file: ${{ steps.iltp.outputs.install_composer_file }}
composer_transform: ${{ steps.iltp.outputs.install_composer_transform}}
composer_backup: ${{ steps.iltp.outputs.install_composer_backup}}
composer_update: ${{ steps.iltp.outputs.install_composer_update}}
composer_update_options: ${{ steps.iltp.outputs.install_composer_update_options}}
composer_dev_ref: ${{ steps.iltp.outputs.install_composer_dev_ref}}
enterprise_github_token: ${{ secrets.enterprise_github_token || github.token }}
copy_script_targets: ${{ steps.iltp.outputs.install_copy_script_targets }}
debug: ${{ needs.init.outputs.debug }}
- name: Run composer for each module
shell: bash
run: |
git clone --depth=1 --quiet --branch v1 https://github.com/joernott/load_testplan.git load_testplan
LOAD_TESTPLAN=$(find ./load_testplan -iname 'main-linux-amd64-*')
chmod a+x "${LOAD_TESTPLAN}"
PREFIXES=$(echo '${{steps.iltp.outputs.runscript_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq)
for PREFIX in ${PREFIXES}; do
VAR="runscript_${PREFIX}_path"
COMPOSER_PATH="${!VAR}"
VAR="runscript_${PREFIX}_composer_transform"
COMPOSER_TRANSFORM="${!VAR}"
VAR="runscript_${PREFIX}_composer_early"
EARLY="${!VAR}"
[ -z "${EARLY}" ] && EARLY="${runscript_composer_early}"
E="runscript_${PREFIX}_composer_early=='${EARLY}'"
if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then
echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m"
else
if [ -n "${COMPOSER_TRANSFORM}" ]; then
echo -e "\033[0;35mtransforming composer.json for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path'\033[0m"
echo "${COMPOSER_TRANSFORM}" > .composer_merge.tmp.json
export INPUT_FILES="source/${COMPOSER_PATH}/composer.json,.composer_merge.tmp.json"
export INPUT_INPUT_TYPE="json"
export INPUT_JSON="source/${COMPOSER_PATH}/composer.json"
"${LOAD_TESTPLAN}"
unset INPUT_FILES INPUT_INPUT_TYPE INPUT_JSON
rm .composer_merge.tmp.json
fi
echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path, ${E}'\033[0m"
docker compose ${{ steps.iltp.outputs.install_container_method }} -T \
${{ steps.iltp.outputs.install_container_options }} \
${{ steps.iltp.outputs.install_container_name }} \
composer update ${{ steps.iltp.outputs.install_composer_update_options}} -d "/var/www/${COMPOSER_PATH}"
fi
done
PREFIXES=$(echo '${{steps.iltp.outputs.runslim_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq)
for PREFIX in ${PREFIXES}; do
VAR="runslim_${PREFIX}_path"
COMPOSER_PATH="${!VAR}"
VAR="runslim_${PREFIX}_composer_transform"
COMPOSER_TRANSFORM="${!VAR}"
VAR="runslim_${PREFIX}_composer_early"
EARLY="${!VAR}"
[ -z "${EARLY}" ] && EARLY="${runslim_composer_early}"
E="runslim_${PREFIX}_composer_early=='${EARLY}'"
if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then
echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m"
else
if [ -n "${COMPOSER_TRANSFORM}" ]; then
echo -e "\033[0;35mtransforming composer.json for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path'\033[0m"
echo "${COMPOSER_TRANSFORM}" > .composer_merge.tmp.json
export INPUT_FILES="source/${COMPOSER_PATH}/composer.json,.composer_merge.tmp.json"
export INPUT_INPUT_TYPE="json"
export INPUT_JSON="source/${COMPOSER_PATH}/composer.json"
"${LOAD_TESTPLAN}"
unset INPUT_FILES INPUT_INPUT_TYPE INPUT_JSON
rm .composer_merge.tmp.json
fi
echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runslim_${PREFIX}_path, ${E}\033[0m"
docker compose ${{ steps.iltp.outputs.install_container_method }} -T \
${{ steps.iltp.outputs.install_container_options }} \
${{ steps.iltp.outputs.install_container_name }} \
composer update ${{ steps.iltp.outputs.install_composer_update_options}} -d "/var/www/${COMPOSER_PATH}"
fi
done
rm -rf ./load_testplan
- name: Generate debugging script for running composer for each module
if: ${{ inputs.debug == true }}
shell: bash
run: |
echo "banner 'Run composer for each module'" >>debug/debug.sh
PREFIXES=$(echo '${{steps.iltp.outputs.runscript_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq)
echo -e "\033[0;35mUnique prefixes: ${PREFIXES}\033[0m"
for PREFIX in ${PREFIXES}; do
VAR="runscript_${PREFIX}_path"
COMPOSER_PATH="${!VAR}"
VAR="runscript_${PREFIX}_composer_transform"
COMPOSER_TRANSFORM="${!VAR}"
VAR="runscript_${PREFIX}_composer_early"
EARLY="${!VAR}"
[ -z "${EARLY}" ] && EARLY="${runscript_composer_early}"
E="runscript_${PREFIX}_composer_early=='${EARLY}'"
if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then
cat >>debug/debug.sh <<EODS
echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m"
EODS
else
if [ -n "${COMPOSER_TRANSFORM}" ]; then
JSON=$(cat "source/${COMPOSER_PATH}/composer.json")
cat >>debug/debug.sh <<EODS
echo -e "\033[0;35mSimulating composer transform for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path', ${E}\033[0m"
cp "source/${COMPOSER_PATH}/composer.json" "source/${COMPOSER_PATH}/composer.json.bak"
cat >"source/${COMPOSER_PATH}/composer.json" <<'EOF'
${JSON}
EOF
EODS
fi
cat >>debug/debug.sh <<EODS
echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path'\033[0m"
docker compose ${{ steps.iltp.outputs.install_container_method }} -T \
${{ steps.iltp.outputs.install_container_options }} \
--workdir "/var/www/${COMPOSER_PATH}" \
${{ steps.iltp.outputs.install_container_name }} \
composer update ${{ steps.iltp.outputs.install_composer_update_options}}
EODS
fi
done
PREFIXES=$(echo '${{steps.iltp.outputs.runslim_matrix_script}}'|tr ',' '\n'|tr -d '[]" '|sed -e 's|-|_|g' -e 's|:.*||'|sort|uniq)
echo -e "\033[0;35mUnique prefixes: ${PREFIXES}\033[0m"
for PREFIX in ${PREFIXES}; do
VAR="runslim_${PREFIX}_path"
COMPOSER_PATH="${!VAR}"
VAR="runslim_${PREFIX}_composer_transform"
COMPOSER_TRANSFORM="${!VAR}"
VAR="runslim_${PREFIX}_composer_early"
EARLY="${!VAR}"
[ -z "${EARLY}" ] && EARLY="${runslim_composer_early}"
E="runslim_${PREFIX}_composer_early=='${EARLY}'"
if [[ -n "${COMPOSER_PATH}" && "${EARLY}" != 'true' ]]; then
cat >>debug/debug.sh <<EODS
echo -e "\033[0;35mSkipping composer install for '${PREFIX}', ${E}\033[0m"
EODS
else
if [ -n "${COMPOSER_TRANSFORM}" ]; then
JSON=$(cat "source/${COMPOSER_PATH}/composer.json")
cat >>debug/debug.sh <<EODS
echo -e "\033[0;35mSimulating composer transform for '${PREFIX}' in '${COMPOSER_PATH}' using 'runscript_${PREFIX}_path', ${E}\033[0m"
cp "source/${COMPOSER_PATH}/composer.json" "source/${COMPOSER_PATH}/composer.json.bak"
cat >"source/${COMPOSER_PATH}/composer.json" <<'EOF'
${JSON}
EOF
EODS
fi
cat >>debug/debug.sh <<EODS
echo -e "\033[0;35mRuning composer install for '${PREFIX}' in '${COMPOSER_PATH}' using 'runslim_${PREFIX}_path'\033[0m"
docker compose ${{ steps.iltp.outputs.install_shop_with_modules_container_method }} -T \
${{ steps.iltp.outputs.install_shop_with_modules_container_options }} \
--workdir "/var/www/${COMPOSER_PATH}" \
${{ steps.iltp.outputs.install_shop_with_modules_container_name }} \
composer update ${{ steps.iltp.outputs.install_shop_with_modules_composer_update_options}}
EODS
fi
done
cat >>debug/debug.sh <<EODS
docker compose ${{ steps.iltp.outputs.install_shop_with_modules_container_method }} -T \
${{ steps.iltp.outputs.install_shop_with_modules_container_options }} \
${{ steps.iltp.outputs.install_shop_with_modules_container_name }} \
composer update ${{ steps.iltp.outputs.install_shop_with_modules_composer_update_options}}
EODS
- name: 'Stop shop for preparedShop cache'
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' }}
uses: 'OXID-eSales/github-actions/stop_shop@v4'
with:
debug: ${{ needs.init.outputs.debug }}
- name: Cache preparedShop on s3
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && needs.init.outputs.use_private_cache == 'true' }}
uses: tespkg/actions-cache/save@v1
with:
path: |
./*
key: '${{ steps.iltp.outputs.install_cache_prepared_shop_prefix }}_${{steps.itn.outputs.matrix_suffix}}'
endpoint: ${{ secrets.CACHE_ENDPOINT }}
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
bucket: ${{ steps.iltp.outputs.install_cache_bucket }}
- name: Cache preparedShop on github
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && needs.init.outputs.use_private_cache != 'true'}}
uses: actions/cache/save@v4
with:
path: |
./*
key: '${{ steps.iltp.outputs.install_cache_prepared_shop_prefix }}_${{steps.itn.outputs.matrix_suffix}}'
- name: Debug cache preparedShop
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' }}
shell: bash
run: |
# install: Debug cache current installation
# we need to add the dot folders here explicitly because bash works differently than the action
MATRIX='PHP${{matrix.php}}-MYSQL${{matrix.mysql}}'
CACHE_NAME="${{ steps.iltp.outputs.install_cache_prepared_shop_prefix}}_${{steps.iltp.outputs.global_title}}-${MATRIX}"
echo 'banner "install: Debug cache current installation"'
echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh
- name: 'Start shop after caching preparedShop'
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' }}
shell: bash
run: |
# install: Start containers
${{ needs.init.outputs.debug }}
echo -e "\033[0;35m### Starting containers\033[0m"
make up
- name: 'Install shop (legacy)'
if: ${{ steps.iltp.outputs.install_method == 'legacy' && steps.iltp.outputs.install_skip_shop_installation == 'false' }}
uses: 'OXID-eSales/github-actions/install_shop@v4'
with:
container_name: ${{ steps.iltp.outputs.install_container_name }}
container_options: ${{ steps.iltp.outputs.install_container_options }}
container_method: ${{ steps.iltp.outputs.install_container_method }}
is_enterprise: ${{ steps.iltp.outputs.install_is_enterprise }}
config_idebug: ${{ steps.iltp.outputs.install_config_idebug }}
debug: ${{ needs.init.outputs.debug }}
- name: 'Debug Install shop (script)'
if: ${{ steps.iltp.outputs.install_method == 'script' && steps.iltp.outputs.install_skip_shop_installation == 'false' }}
run: |
echo "banner 'Install shop (script)'" >>debug/debug.sh
VARS=$(env|grep -E "^global_|^install_|^custom_|^secrets_"|grep -v "^install_shop_with_modules_"|grep -v "|_transform=")
IFS=$'\n'
while read -r E ; do
IFS='=' read -ra EXP <<< "$E"
VAL=("${EXP[@]:1}")
# shellcheck disable=SC2145
echo "export ${EXP[0]}='${VAL[@]}'" >>debug/debug.sh
done <<< "$VARS"
cat >>debug/debug.sh <<'EOF'
SCRIPT="${{ steps.iltp.outputs.install_script }}"
if [ -f "${SCRIPT}" ]; then
chmod a+x "${SCRIPT}"
"${SCRIPT}"
else
echo -e "\033[0;31mCould not find ${SCRIPT}\033[0m"
exit 1
fi
if [ -s data/php/logs/error_log.txt ]; then
echo -e "\033[0;35mPHP error log\033[0m"
cat data/php/logs/error_log.txt
fi
EOF
- name: 'Install shop (script)'
if: ${{ steps.iltp.outputs.install_method == 'script' && steps.iltp.outputs.install_skip_shop_installation == 'false' }}
run: |
SCRIPT="${{ steps.iltp.outputs.install_script }}"
if [ -f "${SCRIPT}" ]; then
chmod a+x "${SCRIPT}"
"${SCRIPT}"
else
echo -e "\033[0;31mCould not finds ${SCRIPT}\033[0m"
exit 1
fi
if [ -s data/php/logs/error_log.txt ]; then
echo -e "\033[0;35mPHP error log\033[0m"
cat data/php/logs/error_log.txt
fi
- name: Activate modules
if: ${{ steps.iltp.outputs.install_skip_shop_installation == 'false' }}
shell: bash
run: |
# Activate modules
${{ needs.init.outputs.debug }}
if [ -f 'source/bin/oe-console' ]; then
OE_CONSOLE='bin/oe-console'
else
if [ -f 'source/vendor/bin/oe-console' ]; then
OE_CONSOLE='vendor/bin/oe-console'
else
echo -e "\033[0;31mCan't find oe-console in bin or vendor/bin!\033[0m"
exit 1
fi
fi
MODULES=$(echo -n "${{ steps.iltp.outputs.install_activate_modules }}"| tr '\n' ' ')
for MODULE in ${MODULES}; do
echo -e "\033[0;35m### activating module ${MODULE} ###\033[0m"
docker compose ${{ steps.iltp.outputs.install_container_method }} -T \
${{ steps.iltp.outputs.install_container_options }} \
${{ steps.iltp.outputs.install_container_name}} \
${OE_CONSOLE} oe:module:activate "${MODULE}"
done
- name: Write files list
if: always()
shell: bash
run: |
# install: Write files list
find . >files.txt
# Compensate for multiline problems
{
echo 'ARTIFACT_PATHS<<EOF'
echo "${{ steps.iltp.outputs.install_output_files }}" | sed -E 's/,|\s/\n/g'
echo EOF
} >> "${GITHUB_ENV}"
- name: Upload configuration artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: '${{ steps.iltp.outputs.install_output_artifact_prefix }}-${{steps.itn.outputs.matrix_suffix}}'
path: |-
docker*.log
files.txt
generated_testplan.yaml
load_testplan_install.log
${{ env.ARTIFACT_PATHS }}
- name: Run custom scripts
# yamllint disable-line rule:line-length
if: ${{ steps.iltp.outputs.install_custom_script != '' || steps.iltp.outputs.install_custom_script_container != '' }}
uses: 'OXID-eSales/github-actions/run_custom_scripts@v4'
with:
container_name: ${{ steps.iltp.outputs.install_container_name }}
container_options: ${{ steps.iltp.outputs.install_container_options }}
container_method: ${{ steps.iltp.outputs.install_container_method }}
custom_script: ${{ steps.iltp.outputs.install_custom_script }}
custom_script_container: ${{ steps.iltp.outputs.install_custom_script_container }}
debug: ${{ needs.init.outputs.debug }}
- name: 'Stop shop'
if: ${{ always() }}
uses: 'OXID-eSales/github-actions/stop_shop@v4'
with:
debug: ${{ needs.init.outputs.debug }}
- name: Debug cache current installation
if: ${{ inputs.debug }}
shell: bash
run: |
# install: Debug cache current installation
# we need to add the dot folders here explicitly because bash works differently than the action
MATRIX='PHP${{matrix.php}}-MYSQL${{matrix.mysql}}'
CACHE_NAME="${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.iltp.outputs.global_title}}-${MATRIX}"
echo "write_cache '${CACHE_NAME}' ./* .env .env.dist .gitignore .git" >>debug/debug.sh
- name: Cache current installation on s3
if: ${{ needs.init.outputs.use_private_cache == 'true' }}
uses: tespkg/actions-cache/save@v1
with:
path: |
./*
key: '${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.itn.outputs.matrix_suffix}}'
endpoint: ${{ secrets.CACHE_ENDPOINT }}
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
bucket: ${{ steps.iltp.outputs.install_cache_bucket }}
- name: Cache current installation on github
if: ${{ needs.init.outputs.use_private_cache != 'true' }}
uses: actions/cache/save@v4
with:
path: |
./*
key: '${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.itn.outputs.matrix_suffix}}'
- name: 'Write Report'
if: always()
uses: OXID-eSales/github-actions/append_report@v4
with:
prefix: '${{ needs.init.outputs.global_title }}'
priority: '020'
phase: install
job: install
php: ${{matrix.php}}
mysql: ${{matrix.mysql}}
status: ${{job.status}}
# yamllint disable rule:line-length
cached_object: |
${{ steps.iltp.outputs.install_cache_prepared_shop_prefix}}_${{steps.iltp.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}
${{ steps.iltp.outputs.install_cache_prefix}}_${{steps.iltp.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}
# yamllint enable rule:line-length
debug: ${{ inputs.debug }}
github_token: ${{ secrets.enterprise_github_token || github.token }}
runscript:
needs: ['init', 'install']
if: ${{ needs.init.outputs.runscript_matrix_script != 'skip' }}
strategy:
matrix:
php: ${{ fromJSON(needs.init.outputs.runscript_matrix_php) }}
mysql: ${{ fromJSON(needs.init.outputs.runscript_matrix_mysql) }}
script: ${{ fromJSON(needs.init.outputs.runscript_matrix_script) }}
fail-fast: false
max-parallel: ${{ fromJSON(needs.init.outputs.runscript_max_parallel) }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
env:
MATRIX_PHP: ${{ matrix.php }}
MATRIX_MYSQL: ${{ matrix.mysql }}
steps:
- name: Load cached testplan
id: rstn
uses: OXID-eSales/github-actions/load_cached_testplan@v4
with:
php: ${{ matrix.php }}
mysql: ${{ matrix.mysql }}
prefix: '${{ needs.init.outputs.global_title }}'
root_testplan: ${{ needs.init.outputs.testplan }}
matrix_testplan: ''
plan_folder: ${{ inputs.plan_folder }}
cache_name: ${{ needs.init.outputs.init_cache_name }}
cache_endpoint: ${{ secrets.CACHE_ENDPOINT }}
cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }}
cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }}
cache_bucket: ${{ needs.init.outputs.init_cache_bucket }}
debug: ${{ needs.init.outputs.debug }}
- name: 'Load Testplan'
id: rsltp
uses: 'joernott/load_testplan@v1'
with:
files: '${{steps.rstn.outputs.testplan}}'
set_output: true
set_print: true
set_env: true
yaml: generated_testplan.yaml
loglevel: info
logfile: load_testplan_runscript.log
token: ${{ secrets.enterprise_github_token || github.token }}
- name: Convert variables
id: rt
shell: bash
run: |
${{ needs.init.outputs.debug }}
set +x
E=$(env|grep -e "^runscript_")
MATRIX_SCRIPT='${{ matrix.script }}'
if [[ ${MATRIX_SCRIPT} != *":"* ]]; then
echo -e "\033[0;31m ${X} does not contain a ':'. You need to specify scripts as '<prefix>:<script_name>'"
exit 1
fi
IFS=':' read -r -a S <<< "${MATRIX_SCRIPT}"
PREFIX="${S[0]//-/_}"
SCRIPT="${S[1]}"
echo "runscript_script=${SCRIPT}"|tee -a "${GITHUB_OUTPUT}"
for KEY in docker_login load_shop \
container_name container_options container_method \
cache_bucket \
composer_file composer_backup composer_transform composer_update composer_update_options composer_early \
custom_script custom_script_container \
path install_options \
output_prefix coverage_prefix; do
VAR="runscript_${PREFIX}_${KEY}"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR="runscript_${KEY}"
fi
echo "runscript_${KEY}=${!VAR}"
cat >>"${GITHUB_OUTPUT}" <<EOF
runscript_${KEY}<<runscript_${KEY}_delimeter
${!VAR}
runscript_${KEY}_delimeter
EOF
export "runscript_${KEY}"="${!VAR}"
done
if [ "${runscript_composer_early}" == 'false' ]; then
echo 'runscript_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}"
fi
# If runscript_workdir is ~, it will be set to the value of runscript_path
VAR="runscript_${PREFIX}_workdir"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR='runscript_workdir'
fi
if [ "${!VAR}" == '~' ]; then
echo "runscript_workdir=${runscript_path}"| tee -a "${GITHUB_OUTPUT}"
else
echo "runscript_workdir=${!VAR}"| tee -a "${GITHUB_OUTPUT}"
fi
SUFFIX="${PREFIX}_${SCRIPT}-${{ steps.rstn.outputs.matrix_suffix }}"
echo "runscript_suffix=${SUFFIX}"| \
sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \
sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g'| \
tee -a "${GITHUB_OUTPUT}"
echo "runscript_title=${PREFIX}_${SCRIPT}"| \
sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \
sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' | \
tee -a "${GITHUB_OUTPUT}"
- name: 'Start shop'
uses: 'OXID-eSales/github-actions/start_shop@v4'
with:
cached_shop: '${{ steps.rt.outputs.runscript_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}'
cache_bucket: ${{ steps.rt.outputs.runscript_cache_bucket }}
cache_endpoint: ${{ secrets.CACHE_ENDPOINT }}
cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }}
cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }}
docker_login: ${{ steps.rt.outputs.runscript_docker_login }}
docker_user: ${{ secrets.DOCKER_HUB_USER }}
docker_token: ${{ secrets.DOCKER_HUB_TOKEN }}
wait_for_selenium: true
debug: ${{ needs.init.outputs.debug }}
- name: 'Modify composer.json'
# Also run this if there is a transformation but composer_early is set to 'skip'
if: ${{ steps.rt.outputs.runscript_composer_transform != '' && steps.rt.outputs.runscript_composer_early != 'true' }}
uses: 'OXID-eSales/github-actions/composer_merge@v4'
with:
file: 'source/${{ steps.rt.outputs.runscript_path }}/composer.json'
backup: true
transform: |
${{ steps.rt.outputs.runscript_composer_transform }}
update: ${{ steps.rt.outputs.runscript_composer_update }}
update_options: '${{ steps.rt.outputs.runscript_composer_update_options }} -d /var/www/${{ steps.rt.outputs.runscript_path }}'
container_name: ${{ steps.rt.outputs.runscript_container_name }}
container_options: ${{ steps.rt.outputs.runscript_container_options }}
container_method: 'exec'
debug: ${{ needs.init.outputs.debug }}
github_token: ${{ secrets.enterprise_github_token || github.token }}
- name: Run composer if there is no transform
# Only run this if there is no transformation and composer_early is set to 'false'
if: ${{ steps.rt.outputs.runscript_composer_transform == '' && steps.rt.outputs.runscript_composer_early == 'false' }}
run: |
# run composer
${{ inputs.debug }}
docker compose exec -T \
${{ steps.rt.outputs.runscript_container_options }} \
${{ steps.rt.outputs.runscript_container_name }} \
composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}"
docker compose exec -T \
${{ steps.rt.outputs.runscript_container_options }} \
${{ steps.rt.outputs.runscript_container_name }} \
composer update --no-interaction -d "/var/www/${{ steps.rt.outputs.runscript_path }}"
- name: Run custom scripts
if: ${{ steps.rt.outputs.runscript_custom_script != '' || steps.rt.outputs.runscript_custom_script_container != '' }}
uses: 'OXID-eSales/github-actions/run_custom_scripts@v4'
with:
container_name: ${{ steps.rt.outputs.runscript_container_name }}
container_options: ${{ steps.rt.outputs.runscript_container_options }}
container_method: ${{ steps.rt.outputs.runscript_container_method }}
custom_script: ${{ steps.rt.outputs.runscript_custom_script }}
custom_script_container: ${{ steps.rt.outputs.runscript_custom_script_container }}
debug: ${{ needs.init.outputs.debug }}
token: ${{ github.token }}
- name: 'Run runscript check'
uses: 'OXID-eSales/github-actions/run_test_script@v4'
with:
script: ${{ steps.rt.outputs.runscript_script }}
path: ${{ steps.rt.outputs.runscript_path }}
workdir: ${{ steps.rt.outputs.runscript_workdir }}
run_composer_install: ${{ steps.rt.outputs.runscript_run_composer_install }}
install_options: ${{ steps.rt.outputs.runscript_install_options }}
container_name: ${{ steps.rt.outputs.runscript_container_name }}
container_options: ${{ steps.rt.outputs.runscript_container_options }}
container_method: ${{ steps.rt.outputs.runscript_container_method }}
output_artifact: ${{ steps.rt.outputs.runscript_output_prefix}}-${{steps.rt.outputs.runscript_suffix }}
debug: ${{ needs.init.outputs.debug }}
github_token: ${{ secrets.enterprise_github_token || github.token }}
- name: Upload coverage report
if: ${{ always() && steps.rt.outputs.runscript_coverage_prefix != '' }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.rt.outputs.runscript_coverage_prefix}}-${{steps.rt.outputs.runscript_suffix }}
path: source/${{ steps.rt.outputs.runscript_path }}/tests/Reports/*
- name: 'Stop shop'
if: ${{ always() }}
uses: 'OXID-eSales/github-actions/stop_shop@v4'
with:
debug: ${{ needs.init.outputs.debug }}
- name: 'Write Report'
if: always()
uses: OXID-eSales/github-actions/append_report@v4
with:
prefix: '${{ needs.init.outputs.global_title }}'
priority: '100'
phase: test
job: runscript
title: '${{ steps.rt.outputs.runscript_title }}'
php: ${{matrix.php}}
mysql: ${{matrix.mysql}}
status: ${{job.status}}
debug: ${{ inputs.debug }}
github_token: ${{ secrets.enterprise_github_token || github.token }}
runslim:
needs: ['init', 'install']
if: ${{ needs.init.outputs.runslim_matrix_script != 'skip' }}
strategy:
matrix:
php: ${{ fromJSON(needs.init.outputs.runslim_matrix_php) }}
mysql: ${{ fromJSON(needs.init.outputs.runslim_matrix_mysql) }}
script: ${{ fromJSON(needs.init.outputs.runslim_matrix_script) }}
fail-fast: false
max-parallel: ${{ fromJSON(needs.init.outputs.runslim_max_parallel) }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
env:
MATRIX_PHP: ${{ matrix.php }}
MATRIX_MYSQL: ${{ matrix.mysql }}
steps:
- name: Load cached testplan
id: rstn
uses: OXID-eSales/github-actions/load_cached_testplan@v4
with:
php: ${{ matrix.php }}
mysql: ${{ matrix.mysql }}
prefix: '${{ needs.init.outputs.global_title }}'
root_testplan: ${{ needs.init.outputs.testplan }}
matrix_testplan: ''
plan_folder: ${{ inputs.plan_folder }}
cache_name: ${{ needs.init.outputs.init_cache_name }}
cache_endpoint: ${{ secrets.CACHE_ENDPOINT }}
cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }}
cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }}
cache_bucket: ${{ needs.init.outputs.init_cache_bucket }}
debug: ${{ needs.init.outputs.debug }}
- name: 'Load Testplan'
id: rsltp
uses: 'joernott/load_testplan@v1'
with:
files: '${{steps.rstn.outputs.testplan}}'
set_output: true
set_print: true
set_env: true
yaml: generated_testplan.yaml
loglevel: info
logfile: load_testplan_runslim.log
token: ${{ secrets.enterprise_github_token }}
- name: Convert variables
id: rt
shell: bash
run: |
${{ needs.init.outputs.debug }}
set +x
E=$(env|grep -e "^runslim_")
MATRIX_SCRIPT='${{ matrix.script }}'
if [[ ${MATRIX_SCRIPT} != *":"* ]]; then
echo -e "\033[0;31m ${X} does not contain a ':'. You need to specify scripts as '<prefix>:<script_name>'"
exit 1
fi
IFS=':' read -r -a S <<< "${MATRIX_SCRIPT}"
PREFIX="${S[0]//-/_}"
SCRIPT="${S[1]}"
echo "runslim_script=${SCRIPT}"|tee -a "${GITHUB_OUTPUT}"
for KEY in docker_login load_shop \
container_name container_options container_method \
cache_bucket \
composer_file composer_backup composer_transform composer_update composer_update_options composer_early \
custom_script custom_script_container \
path install_options \
output_prefix coverage_prefix; do
VAR="runslim_${PREFIX}_${KEY}"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR="runslim_${KEY}"
fi
echo "runslim_${KEY}=${!VAR}"
cat >>"${GITHUB_OUTPUT}" <<EOF
runslim_${KEY}<<runslim_${KEY}_delimeter
${!VAR}
runslim_${KEY}_delimeter