-
-
Notifications
You must be signed in to change notification settings - Fork 270
133 lines (113 loc) · 3.95 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
130
131
name: CI
on: [pull_request]
jobs:
test:
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1']
experimental: [false]
include:
- php-version: 7.2
experimental: true
- php-version: 7.3
experimental: true
- php-version: 8.2
experimental: true
steps:
- uses: actions/checkout@v2
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
env:
COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }}
- name: Setup Packages
run: |
cd $GITHUB_WORKSPACE
sudo apt update
sudo apt install rsync
# - name: Cache Composer dependencies
# uses: actions/cache@v2
# with:
# path: /tmp/composer-cache
# key: ${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
- name: Install dependencies
uses: php-actions/composer@v6
with:
dev: yes
args: --prefer-dist --no-interaction
php_version: ${{ matrix.php-version }}
php_extensions: xml
version: 2
- name: Report Versions
run: |
google-chrome --version
lsb_release -a
php -v
chromedriver -v
geckodriver -V
which geckodriver
which chromedriver
firefox -v
vendor/bin/behat -V
mysql --version
mysqladmin --version
- name: Create Database
run: |
sudo systemctl start mysql.service
sudo mysql -proot -e 'drop database if exists phplistdb'
sudo mysqladmin -proot create phplistdb
sudo mysql -proot -e 'create user phplist@"%" identified by "phplist"; grant all on phplistdb.* to phplist@"%"'
- name: Set bootlist theme
run: |
cd $GITHUB_WORKSPACE/public_html/lists/admin/ui/
wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz
tar -xzf master.tar.gz
mv phplist-ui-bootlist-master phplist-ui-bootlist
rm master.tar.gz
- name: Start Test Server
run: |
cd $GITHUB_WORKSPACE
cp -fv tests/ci/behat.yml tests/behat.yml
cp -fv tests/ci/config.php public_html/lists/config/config.php
mkdir -p output/screenshots
touch output/screenshots/README.md
mkdir -p build/mails
./bin/start-selenium > output/selenium.log 2>&1 &
sleep 5
sudo php -S 0.0.0.0:80 -t public_html > /dev/null 2>&1 &
- name: Check PHP syntax errors
uses: overtrue/[email protected]
with:
path: ./public_html
- name: Run BDD Tests UI
run: |
cd $GITHUB_WORKSPACE/tests
../vendor/bin/behat -p chrome -f progress --stop-on-failure --tags=@initialise
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip"
- name: Run BDD Tests CLI
run: |
cd $GITHUB_WORKSPACE
export [email protected]
export ADMIN_PASSWORD=Mypassword123+
export ORGANISATION_NAME="phpList"
export ADMIN_NAME="phpList Administrator"
php public_html/lists/admin/index.php -c $GITHUB_WORKSPACE/public_html/lists/config/config.php -p initialise -f
cd $GITHUB_WORKSPACE/tests
../vendor/bin/behat -p chrome --tags="~@initialise && ~@wip"
- name: Upload the screenshots
if: always()
uses: actions/upload-artifact@v2
with:
path: "output"
name: "behat output ${{ matrix.php-version }}"
retention-days: 3
- name: Display output
run: |
cd $GITHUB_WORKSPACE
# find . -type f
# cat output/selenium.log
if: ${{ failure() }}