Skip to content

Commit

Permalink
Update github-actions to 4.14.12 (#166)
Browse files Browse the repository at this point in the history
* Don't activate modules for components
* Fix field renames in component template
* Fix cache handling for ee/pe
* Handle Tests and tests folders in run_test_script
* Pass github token to script in run_test_script
  • Loading branch information
release-github-action[bot] authored Jul 8, 2024
1 parent 06217ab commit 4b522de
Show file tree
Hide file tree
Showing 17 changed files with 93 additions and 31 deletions.
1 change: 0 additions & 1 deletion .github/oxid-esales/defaults/7.0.x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ workflow:
global:
git: &git
default_ref: &default_ref 'b-7.0.x'
safe_ref_name: 'b-7.0.x'
enterprise_ref: 'b-7.0.x'

composer: &composer
Expand Down
1 change: 0 additions & 1 deletion .github/oxid-esales/defaults/7.0.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ workflow:
global:
git: &git
default_ref: &default_ref 'b-7.0.x'
safe_ref_name: 'b-7.0.x'
enterprise_ref: 'b-7.0.x'

composer: &composer
Expand Down
1 change: 0 additions & 1 deletion .github/oxid-esales/defaults/7.1.x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ workflow:
global:
git: &git
default_ref: &default_ref 'b-7.1.x'
safe_ref_name: 'b-7.1.x'
enterprise_ref: 'b-7.1.x'

composer: &composer
Expand Down
1 change: 0 additions & 1 deletion .github/oxid-esales/defaults/7.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ workflow:
global:
git: &git
default_ref: &default_ref 'b-7.1.x'
safe_ref_name: 'b-7.1.x'
enterprise_ref: 'b-7.1.x'

composer: &composer
Expand Down
1 change: 0 additions & 1 deletion .github/oxid-esales/defaults/7.2.x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ workflow:
global:
git: &git
default_ref: &default_ref 'b-7.2.x'
safe_ref_name: 'b-7.2.x'
enterprise_ref: 'b-7.2.x'

composer: &composer
Expand Down
1 change: 0 additions & 1 deletion .github/oxid-esales/defaults/7.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ workflow:
global:
git: &git
default_ref: &default_ref 'b-7.2.x'
safe_ref_name: 'b-7.2.x'
enterprise_ref: 'b-7.2.x'

composer: &composer
Expand Down
9 changes: 7 additions & 2 deletions .github/oxid-esales/defaults/component.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
install_shop_with_modules:
method: legacy
cache:
prepared_shop: false
git:
# Deprecated, remove in v5
shop_url: 'https://github.com/{{ .Data.global.repo }}.git'
shop_ref: '{{ .Data.global.git.safe_ref_name }}'
# Deprecated, remove in v5
shop_ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}'
repository: '{{ .Data.global.repo }}'
ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}'
composer:
root_url: ''
transform: ''
Expand Down Expand Up @@ -38,4 +43,4 @@ runslim:
<<: *runscript

finish:
slack_title: '{{ print .Data.global.name}} ({{ .Data.global.git.shop_ref }}) by {{ .Github.Actor }}'
slack_title: '{{ print .Data.global.name}} ({{ .Data.global.git.safe_ref_name }}) by {{ .Github.Actor }}'
9 changes: 7 additions & 2 deletions .github/oxid-esales/defaults/component.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
install_shop_with_modules:
method: legacy
cache:
prepared_shop: false
git:
# Deprecated, remove in v5
shop_url: 'https://github.com/{{ .Data.global.repo }}.git'
shop_ref: '{{ .Data.global.git.safe_ref_name }}'
# Deprecated, remove in v5
shop_ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}'
repository: '{{ .Data.global.repo }}'
ref: '{{ .Data.install_shop_with_modules.git.safe_ref_name }}'
composer:
root_url: ''
transform: ''
Expand Down Expand Up @@ -38,4 +43,4 @@ runslim:
<<: *runscript

finish:
slack_title: '{{ print .Data.global.name}} ({{ .Data.global.git.shop_ref }}) by {{ .Github.Actor }}'
slack_title: '{{ print .Data.global.name}} ({{ .Data.global.git.safe_ref_name }}) by {{ .Github.Actor }}'
11 changes: 9 additions & 2 deletions .github/oxid-esales/defaults/ee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ install_shop_with_modules: &install
is_enterprise: *is_enterprise
cache:
# Needs to be here as $shop_type is different
prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'

# BEGIN Deprecated, will be superseded by install:
prepare_shop: *install
Expand All @@ -76,7 +77,7 @@ install_shop:
git: *git
is_enterprise: *is_enterprise
cache:
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: *install_shop_prefix

install_module:
cache:
Expand Down Expand Up @@ -140,6 +141,12 @@ runtest:
coverage:
path: ''

runscript:
load_shop: *install_shop_prefix

runslim:
load_shop: *install_shop_prefix

sonarcloud:
matrix:
testplan: 'skip'
Expand Down
11 changes: 9 additions & 2 deletions .github/oxid-esales/defaults/ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ install_shop_with_modules: &install
is_enterprise: *is_enterprise
cache:
# Needs to be here as $shop_type is different
prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'

# BEGIN Deprecated, will be superseded by install:
prepare_shop: *install
Expand All @@ -76,7 +77,7 @@ install_shop:
git: *git
is_enterprise: *is_enterprise
cache:
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: *install_shop_prefix

install_module:
cache:
Expand Down Expand Up @@ -140,6 +141,12 @@ runtest:
coverage:
path: ''

runscript:
load_shop: *install_shop_prefix

runslim:
load_shop: *install_shop_prefix

sonarcloud:
matrix:
testplan: 'skip'
Expand Down
11 changes: 9 additions & 2 deletions .github/oxid-esales/defaults/pe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ install_shop_with_modules: &install
is_enterprise: *is_enterprise
cache:
# Needs to be here as $shop_type is different
prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'

# BEGIN Deprecated, will be superseded by install:
prepare_shop: *install
Expand All @@ -66,7 +67,7 @@ install_shop:
git: *git
is_enterprise: *is_enterprise
cache:
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: *install_shop_prefix

install_module:
cache:
Expand Down Expand Up @@ -124,6 +125,12 @@ runtest:
coverage:
path: ''

runscript:
load_shop: *install_shop_prefix

runslim:
load_shop: *install_shop_prefix

sonarcloud:
matrix:
testplan: 'skip'
Expand Down
11 changes: 9 additions & 2 deletions .github/oxid-esales/defaults/pe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ install_shop_with_modules: &install
is_enterprise: *is_enterprise
cache:
# Needs to be here as $shop_type is different
prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prepared_shop_prefix: 'preparedShop-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'

# BEGIN Deprecated, will be superseded by install:
prepare_shop: *install
Expand All @@ -66,7 +67,7 @@ install_shop:
git: *git
is_enterprise: *is_enterprise
cache:
prefix: &install_shop_prefix 'shopInstallation-{{ $shop_type }}-{{ .Github.SHA }}-{{ .Github.RunID }}'
prefix: *install_shop_prefix

install_module:
cache:
Expand Down Expand Up @@ -124,6 +125,12 @@ runtest:
coverage:
path: ''

runscript:
load_shop: *install_shop_prefix

runslim:
load_shop: *install_shop_prefix

sonarcloud:
matrix:
testplan: 'skip'
Expand Down
1 change: 1 addition & 0 deletions .github/oxid-esales/defaults/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ global:
shop_ref: '{{ .Data.global.git.default_ref }}'
ref: '{{ .Data.global.git.default_ref }}'
enterprise_ref: '{{ .Data.global.git.default_ref }}'
safe_ref_name: '{{ .Data.global.git.default_ref }}'
composer: &composer
ref_name: 'dev-{{ .Data.global.git.default_ref }}'

Expand Down
1 change: 1 addition & 0 deletions .github/oxid-esales/defaults/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ global:
shop_ref: '{{ .Data.global.git.default_ref }}'
ref: '{{ .Data.global.git.default_ref }}'
enterprise_ref: '{{ .Data.global.git.default_ref }}'
safe_ref_name: '{{ .Data.global.git.default_ref }}'
composer: &composer
ref_name: 'dev-{{ .Data.global.git.default_ref }}'

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/universal_workflow_light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ jobs:
debug: ${{ needs.init.outputs.debug }}

- name: Cache preparedShop on s3
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && steps.iltp.outputs.use_private_cache == 'true' }}
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && needs.init.outputs.use_private_cache == 'true' }}
uses: tespkg/actions-cache/save@v1
with:
path: |
Expand All @@ -513,7 +513,7 @@ jobs:
bucket: ${{ steps.iltp.outputs.install_cache_bucket }}

- name: Cache preparedShop on github
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && steps.iltp.outputs.use_private_cache != 'true'}}
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && needs.init.outputs.use_private_cache != 'true'}}
uses: actions/cache/save@v4
with:
path: |
Expand Down Expand Up @@ -595,6 +595,7 @@ jobs:
fi
- name: Activate modules
if: ${{ steps.iltp.outputs.install_skip_shop_installation == 'false' }}
shell: bash
run: |
# Activate modules
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/universal_workflow_light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ jobs:
debug: ${{ needs.init.outputs.debug }}

- name: Cache preparedShop on s3
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && steps.iltp.outputs.use_private_cache == 'true' }}
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && needs.init.outputs.use_private_cache == 'true' }}
uses: tespkg/actions-cache/save@v1
with:
path: |
Expand All @@ -513,7 +513,7 @@ jobs:
bucket: ${{ steps.iltp.outputs.install_cache_bucket }}

- name: Cache preparedShop on github
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && steps.iltp.outputs.use_private_cache != 'true'}}
if: ${{ steps.iltp.outputs.install_cache_prepared_shop == 'true' && needs.init.outputs.use_private_cache != 'true'}}
uses: actions/cache/save@v4
with:
path: |
Expand Down Expand Up @@ -595,6 +595,7 @@ jobs:
fi
- name: Activate modules
if: ${{ steps.iltp.outputs.install_skip_shop_installation == 'false' }}
shell: bash
run: |
# Activate modules
Expand Down
44 changes: 35 additions & 9 deletions run_test_script/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,18 @@ runs:
run: |
# run_test_script: Run composer script ${{ inputs.script }}
${{ inputs.debug }}
mkdir -p source/${{ inputs.path }}/tests/Output source/${{ inputs.path }}/tests/Reports
TESTDIR='tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
TESTDIR='Tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }} ###\033[0m"
exit 1
fi
fi
mkdir -p source/${{ inputs.path }}/${TESTDIR}/Output source/${{ inputs.path }}/${TESTDIR}/Reports
echo -e "\033[0;35m### Run composer ${{ inputs.script }} in ${{ inputs.path }} ###\033[0m"
docker compose ${{ inputs.container_method }} -T \
-e GITHUB_TOKEN=${{ inputs.github_token }} \
${{ inputs.container_options }} \
--workdir '/var/www/${{ inputs.path }}' \
${{ inputs.container_name }} \
Expand All @@ -73,17 +82,26 @@ runs:
run: |
# run_test_script: Run shell script ${{ inputs.script }}
${{ inputs.debug }}
mkdir -p source/${{ inputs.path }}/tests/Output source/${{ inputs.path }}/tests/Reports
SCRIPT=$(echo '${{ inputs.script }}'|sed -e "s|^~/|tests/Scripts/|")
TESTDIR='tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
TESTDIR='Tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }} ###\033[0m"
exit 1
fi
fi
mkdir -p "source/${{ inputs.path }}/${TESTDIR}/Output" "source/${{ inputs.path }}/${TESTDIR}/Reports"
SCRIPT=$(echo '${{ inputs.script }}'|sed -e "s|^~/|${TESTDIR}/Scripts/|")
if [ ! -f "source/${{ inputs.path }}/${SCRIPT}" ]; then
SCRIPT=$(echo '${{ inputs.script }}'|sed -e "s|^~/|tests/scripts/|")
SCRIPT=$(echo '${{ inputs.script }}'|sed -e "s|^~/|${TESTDIR}/scripts/|")
fi
if [ ! -f "source/${{ inputs.path }}/${SCRIPT}" ]; then
echo -e "\033[0;31m### Could not find source/${{ inputs.path }}/${SCRIPT} ###\033[0m"
fi
chmod a+x "source/${{ inputs.path }}/${SCRIPT}"
echo -e "\033[0;35m### Run ${SCRIPT} in ${{ inputs.path }} ###\033[0m"
docker compose ${{ inputs.container_method }} -T \
-e GITHUB_TOKEN=${{ inputs.github_token }} \
${{ inputs.container_options }} \
--workdir '/var/www/${{ inputs.path }}' \
${{ inputs.container_name }} \
Expand All @@ -95,18 +113,26 @@ runs:
run: |
# run_test_script: Output php error log
${{ inputs.debug }}
TESTDIR='tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
TESTDIR='Tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }} ###\033[0m"
exit 1
fi
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
touch data/php/logs/error_log.txt
cp data/php/logs/error_log.txt source/${{ inputs.path }}/tests/Output/
cp data/mysql/mysql/slow_log* source/${{ inputs.path }}/tests/Output/
cp data/mysql/mysql/general_log* source/${{ inputs.path }}/tests/Output/
docker compose logs --tail=all >source/${{ inputs.path }}/tests/Output/docker-compose.log
cp data/php/logs/error_log.txt source/${{ inputs.path }}/${TESTDIR}/Output/
cp data/mysql/mysql/slow_log* source/${{ inputs.path }}/${TESTDIR}/Output/
cp data/mysql/mysql/general_log* source/${{ inputs.path }}/${TESTDIR}/Output/
docker compose logs --tail=all >source/${{ inputs.path }}/${TESTDIR}/Output/docker-compose.log
for c in $(docker ps -aq); do
echo -e "\033[0;35m### Logs for $c ###\033[0m"
docker logs -n 2000 $c >source/${{ inputs.path }}/tests/Output/docker-$c.log
docker logs -n 2000 $c >source/${{ inputs.path }}/${TESTDIR}/Output/docker-$c.log
done
- name: Upload artifact
Expand Down

0 comments on commit 4b522de

Please sign in to comment.