-
-
Notifications
You must be signed in to change notification settings - Fork 15
178 lines (157 loc) · 7.34 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
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:
include:
- ibexa_version: 4.6.7
php: 8.1
node: 18.x
- ibexa_version: 4.5.*
php: 8.1
node: 14.x
- ibexa_version: 4.3.0
php: 7.4
node: 14.x
env:
CACHE_POOL: cache.redis
DATABASE_URL: mysql://[email protected]:3306/ezplatform_test
CACHE_DSN: 127.0.0.1:6379
APP_ENV: prod
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@v4
with:
node-version: ${{ matrix.node }}
yarn-version: 1.x
- 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 "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
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 ibexa
mkdir -p ibexa/node_modules && ln -s ibexa/node_modules
cd ibexa
composer require --dev -W phpunit/phpunit:^9.5 --no-scripts
php bin/console ibexa:install
php bin/console ibexa:graphql:generate-schema
yarn add --dev algoliasearch react react-collapsible react-dom react-instantsearch-dom
- name: Run Webserver
run: |
cd ibexa
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 ibexa
echo ::group::..:: Update Composer ::..
rm var/cache/prod -rf
composer update
bin/console d:s:u --force
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 ibexa/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: Dump logs
if: ${{ failure() }}
run: |
cd ibexa
ls -al var/log/
cat var/log/prod*
- 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