-
-
Notifications
You must be signed in to change notification settings - Fork 15
164 lines (142 loc) · 6.82 KB
/
main-ci.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
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
name: CI
on: [ push, pull_request ]
jobs:
lint:
name: Coding Standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: 7.4
id: php
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: Check Sources
run: php vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php src/ components/ bin/
- name: Check Mess Sources
run: php vendor/bin/phpmd src,components,bin text .cs/md_ruleset.xml
ibexa:
name: Ibexa OSS ${{ matrix.ibexa_version }} on PHP${{ matrix.php }}
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:10.4
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: ezplatform_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:latest
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
ibexa_version: [ 4.* ]
php: [ 7.4, 8.1 ]
env:
CACHE_POOL: cache.redis
DATABASE_URL: mysql://[email protected]:3306/ezplatform_test
CACHE_DSN: 127.0.0.1:6379
APP_ENV: dev
APP_DEBUG: 1
COMPOSER_MEMORY_LIMIT: 4G
PANTHER_EXTERNAL_BASE_URI: http://127.0.0.1:8000
SYMFONY_DEPRECATIONS_HELPER: 999999
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 14.18
yarn-version: 1.22
- name: Check JS Version
run: |
node --version
yarn --version
/usr/local/bin/node --version
which node
yarn node --version
rm /usr/local/bin/node
ln -s `which node` /usr/local/bin/node
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl
id: php
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Symfony Server
run: |
wget https://get.symfony.com/cli/installer -O - | bash
mv /home/runner/.symfony5/bin/symfony /usr/local/bin/symfony
symfony local:php:list
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-cache-dir
restore-keys: |
${{ runner.os }}-composer-cache-dir
- name: Install dependencies of the Mono Repo
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: Install Ibexa DXP and Yarn deps
run: |
composer create-project "ibexa/oss-skeleton:${{ matrix.ibexa_version }}" --prefer-dist --no-progress --no-interaction ezplatform
mkdir -p ezplatform/node_modules && ln -s ezplatform/node_modules
cd ezplatform
php bin/console ibexa:install
php bin/console ibexa:graphql:generate-schema
composer run post-update-cmd
yarn add --dev algoliasearch react react-collapsible react-dom react-instantsearch-dom
- name: Run Webserver
run: |
cd ezplatform
symfony local:server:start --no-tls -d
symfony local:server:list
- name: Install All the bundle on Top of a fresh eZ Installation
run: |
for COMPONENT in `ls components`; do
if COMPONENT=${COMPONENT} bin/ci-should install; then
echo ::group::..:: ${COMPONENT} ::..
COMPONENT_CONFIG_DIR="components/${COMPONENT}/tests/provisioning" COMPONENT=${COMPONENT} bin/wrapbundle
echo ::endgroup::
fi
done
cd ezplatform
echo ::group::..:: Update Composer ::..
composer update
php bin/console cache:clear
echo ::endgroup::
echo ::group::..:: Do bundle specifics ::..
mysql -u root -h 127.0.0.1 -P 3306 ezplatform_test < ../components/SEOBundle/bundle/Resources/sql/schema.sql
mysql -u root -h 127.0.0.1 -P 3306 ezplatform_test < ../components/2FABundle/bundle/Resources/sql/schema.sql
echo ::endgroup::
echo ::group::..:: Final Steps ::..
php bin/console cache:clear
echo ::endgroup::
- name: Test Web Server
run: curl -I http://127.0.0.1:8000 | grep "HTTP/1.1 200 OK"
- name: Update PHP Unit
run: |
composer update && composer require -W phpunit/phpunit:^9.5 symfony/phpunit-bridge:^5.3
rm -f ezplatform/config/packages/test/doctrine.yaml
php vendor/bin/bdi detect drivers
- name: Components testing
run: |
for COMPONENT in `ls components`; do
if COMPONENT=${COMPONENT} bin/ci-should test; then
echo ::group::..:: ${COMPONENT} ::..
DATABASE_URL=mysql://[email protected]:3306/ezplatform APP_ENV=test php ./vendor/bin/phpunit -c "components/${COMPONENT}/tests" "components/${COMPONENT}/tests" --exclude-group behat;
echo ::endgroup::
fi
done
- name: Global Mono Repo Testing
run: |
DATABASE_URL=mysql://[email protected]:3306/ezplatform APP_ENV=test php ./vendor/bin/phpunit -c "tests" "tests" --exclude-group behat