-
Notifications
You must be signed in to change notification settings - Fork 486
196 lines (169 loc) · 9.13 KB
/
behat.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
name: Behat tests 🐞
on: [push, pull_request]
jobs:
build:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup apache
run: |
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install nodejs npm apache2 php${{ matrix.php-versions }} php${{ matrix.php-versions }}-common php${{ matrix.php-versions }}-cli libapache2-mod-php${{ matrix.php-versions }}
sudo a2enmod rewrite actions
sudo cp -f .github/gh-apache /etc/apache2/sites-available/000-default.conf
sudo chmod 777 -R $HOME
cat /etc/apache2/sites-available/000-default.conf
sudo service apache2 restart
sudo systemctl restart apache2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, dom, gd, json, soap, zip, bcmath
ini-values: post_max_size=256M, max_execution_time=600, memory_limit=4096M, date.timezone=Europe/Paris
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
# - name: Cache composer dependencies
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies with composer
run: composer install --no-progress
- name: Install assets
run: php bin/console assets:install
# - name: Generate fos_js_routes.json
# run: php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
- name: Install Yarn
run: |
sudo npm i -g npm
node --version
npm --version
sudo corepack enable
yarn set version stable
yarn --version
- name: Get yarn cache directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# - name: Cache yarn dependencies
# uses: actions/cache@v2
# id: yarn-cache
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: ${{ runner.os }}-yarn-
- name: Install JS dependencies
run: |
yarn install
- name: Yarn run encore
run: |
yarn run encore production
- name: Start chrome
run: |
sudo apt-get install google-chrome-stable
google-chrome --version
google-chrome-stable --version
google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
whereis google-chrome-stable
# https://github.com/marketplace/actions/setup-chromedriver
- name: Start chromedriver
uses: nanasess/setup-chromedriver@master
with:
# Optional: do not specify to match Chrome's version
chromedriver-version: '100.0.4896.60'
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Get Selenium
run: |
wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.1.0/selenium-server-4.1.3.jar --quiet
- name: Run Selenium
run: |
java -version
export DISPLAY=:99.0
sudo xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
java -Dwebdriver.chrome.driver=/usr/bin/chromedriver -jar selenium-server-4.1.3.jar standalone --log selenium.log > /dev/null &
- name: Start mysql service
run: |
sudo /etc/init.d/mysql start
sudo systemctl restart apache2
- name: Check PHP settings
run: |
php -ini
php -v
php -m
- name: Check chamilo
run: |
sudo chmod 777 -R ${{ github.workspace }}
curl http://localhost/main/install/index.php
- name: Install chamilo
run: |
cd tests/behat
../../vendor/behat/behat/bin/behat features/actionInstall.feature -vvv
cd ..
cd ..
sed -i "s/APP_ENV='dev'/APP_ENV='prod'/g" .env
sed -i "s/APP_DEBUG='1'/APP_DEBUG='0'/g" .env
sed -i "s/MAILER_DSN=sendmail:\/\/default/MAILER_DSN=null:\/\/null/g" .env
sudo php bin/console cache:clear
sudo chmod -R 777 var public
- name: Behat tests
run: |
cd ${{ github.workspace }}/tests/behat
../../vendor/behat/behat/bin/behat features/actionUserLogin.feature -vvv
../../vendor/behat/behat/bin/behat features/adminFillUsers.feature -vvv
../../vendor/behat/behat/bin/behat features/adminSettings.feature -vv
../../vendor/behat/behat/bin/behat features/career.feature -vvv
../../vendor/behat/behat/bin/behat features/class.feature -vvv
#../../vendor/behat/behat/bin/behat features/companyReports.feature -vvv
../../vendor/behat/behat/bin/behat features/course.feature -vvv
../../vendor/behat/behat/bin/behat features/course_user_registration.feature -vv
../../vendor/behat/behat/bin/behat features/courseCategory.feature -vvv
../../vendor/behat/behat/bin/behat features/createUser.feature -vvv
../../vendor/behat/behat/bin/behat features/createUserViaCSV.feature -vv
../../vendor/behat/behat/bin/behat features/extraFieldUser.feature -vv
../../vendor/behat/behat/bin/behat features/profile.feature -vv
../../vendor/behat/behat/bin/behat features/promotion.feature -vv
# ../../vendor/behat/behat/bin/behat features/registration.feature -vv
../../vendor/behat/behat/bin/behat features/sessionAccess.feature -vv
../../vendor/behat/behat/bin/behat features/sessionManagement.feature -vv
../../vendor/behat/behat/bin/behat features/skill.feature -vv
../../vendor/behat/behat/bin/behat features/socialGroup.feature -vvv
../../vendor/behat/behat/bin/behat features/systemAnnouncements.feature -vvv
../../vendor/behat/behat/bin/behat features/ticket.feature -vvv
../../vendor/behat/behat/bin/behat features/toolAgenda.feature -vvv
../../vendor/behat/behat/bin/behat features/toolAnnouncement.feature -vvv
../../vendor/behat/behat/bin/behat features/toolAttendance.feature -vvv
../../vendor/behat/behat/bin/behat features/toolDocument.feature -vvv
# ../../vendor/behat/behat/bin/behat features/toolExercise.feature -vvv
../../vendor/behat/behat/bin/behat features/toolForum.feature -vvv
../../vendor/behat/behat/bin/behat features/toolGroup.feature -vvv
../../vendor/behat/behat/bin/behat features/toolLink.feature -vvv
../../vendor/behat/behat/bin/behat features/toolLp.feature -vvv
../../vendor/behat/behat/bin/behat features/toolThematic.feature -vvv
../../vendor/behat/behat/bin/behat features/toolWork.feature -vvv
- name: The job has failed
if: ${{ failure() }}
run: |
cat selenium.log