-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (112 loc) · 4.26 KB
/
main.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
name: Testing with OXID eShop-CE
on:
push:
branches:
- b-7.0.x
pull_request:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'
jobs:
run_tests:
strategy:
matrix:
php: [ '8.1' ]
mysql: [ '8.0' ]
fail-fast: false
runs-on: ubuntu-latest
env:
ESHOP_DOCKER_SDK_REPOSITORY: https://github.com/OXID-eSales/docker-eshop-sdk.git
SHOP_CE_REPOSITORY: https://github.com/OXID-eSales/oxideshop_ce.git
SHOP_CE_DEFAULT_BRANCH: b-7.0.x
SHOP_INSTALL_DIR: eshop_ce
DOCKER_SETUP_DIR: source
steps:
- name: Add environment variables
run: |
SHOP_ROOT_DIR="/var/www/$SHOP_INSTALL_DIR"
RUN_PHP="docker-compose run -T -w $SHOP_ROOT_DIR php"
echo "SHOP_ROOT_DIR=$SHOP_ROOT_DIR" >> $GITHUB_ENV
echo "RUN_PHP=$RUN_PHP" >> $GITHUB_ENV
- name: Clone Docker Eshop SDK
run: |
git clone --depth 1 $ESHOP_DOCKER_SDK_REPOSITORY --branch master --single-branch .
- name: Define eShop-CE branch for cloning
run: |
if [[ $(git ls-remote --heads $SHOP_CE_REPOSITORY ${{ github.ref_name }}) ]]; then
SHOP_CE_BRANCH=${{ github.ref_name }};
else
SHOP_CE_BRANCH=$SHOP_CE_DEFAULT_BRANCH;
fi
echo "SHOP_CE_BRANCH=$SHOP_CE_BRANCH" >> $GITHUB_ENV
- name: Clone the shop
run: |
git clone --depth 1 $SHOP_CE_REPOSITORY --branch $SHOP_CE_BRANCH --single-branch $DOCKER_SETUP_DIR/$SHOP_INSTALL_DIR
- name: Prepare container configuration
run: |
make setup
make addbasicservices
perl -pi\
-e "s#PHP_VERSION=.*#PHP_VERSION='${{ matrix.php }}'#g;"\
-e "s#MYSQL_VERSION=.*#MYSQL_VERSION='${{ matrix.mysql }}'#g;"\
.env
perl -pi\
-e 's#display_errors =.*#display_errors = false#g;'\
-e 'print "xdebug.max_nesting_level=1000\n\n";'\
-e 'print "error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING\n"'\
containers/php/custom.ini
perl -pi\
-e 's#/var/www/#$SHOP_ROOT_DIR/source/#g;'\
containers/httpd/project.conf
- name: Start containers
run: |
make up
- name: Require the component (${{ github.ref_name }})
run: |
$RUN_PHP \
composer require oxid-esales/smarty-component:dev-${{ github.ref_name }} --no-update
- name: Require wave-theme
run: |
$RUN_PHP \
composer require oxid-esales/wave-theme --no-update
- name: Require developer-tools
run: |
$RUN_PHP \
composer require oxid-esales/developer-tools --no-update
- name: Run Composer install
run: |
$RUN_PHP \
composer install --no-interaction
- name: Run Install Shop
run: |
$RUN_PHP \
cp source/config.inc.php.dist source/config.inc.php
$RUN_PHP \
bin/oe-console oe:setup:shop --db-host mysql --db-port 3306 --db-name example --db-user root --db-password root --shop-url localhost.localhost --shop-directory $SHOP_ROOT_DIR/source/ --compile-directory $SHOP_ROOT_DIR/source/tmp/
- name: Run reset database
run: |
$RUN_PHP \
php bin/oe-console oe:database:reset --db-host=mysql --db-port=3306 --db-name=example --db-user=root --db-password=root --force
- name: Run activate theme
run: |
$RUN_PHP \
php bin/oe-console oe:theme:activate wave
- name: Run component tests
# Put PHPUnit logs to the eShop log folder
run: |
$RUN_PHP \
php vendor/bin/phpunit \
--configuration phpunit.xml \
--bootstrap /var/www/${{ env.SHOP_INSTALL_DIR }}/tests/bootstrap.php \
vendor/oxid-esales/smarty-component/tests \
--testdox-text source/log/phpunit_log.txt
- name: Upload logged artifacts
uses: actions/upload-artifact@v3
with:
name: eshop_source_log_folder
path: ${{ env.DOCKER_SETUP_DIR }}/${{ env.SHOP_INSTALL_DIR }}/source/log/
retention-days: 7
if-no-files-found: error
- name: Stop containers
run: |
make down