-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (127 loc) · 4.77 KB
/
phpunit.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
name: Run PHPUnit test suites
on: [pull_request, push]
env:
ELGG_DB_PREFIX: c_i_elgg_
ELGG_DB_HOST: 127.0.0.1
ELGG_DB_NAME: elgg
ELGG_DB_USER: root
ELGG_DB_PASS: password
ELGG_WWWROOT: http://localhost:8888/
ELGG_MEMCACHE_SERVER1_HOST: 127.0.0.1
ELGG_MEMCACHE_SERVER1_PORT: 11211
ELGG_MEMCACHE_NAMESPACE_PREFIX: elgg_
ELGG_REDIS_SERVER1_HOST: 127.0.0.1
ELGG_REDIS_SERVER1_PORT: 6379
jobs:
phpunit:
name: PHP ${{ matrix.php-versions }} - ${{ matrix.db-image }} ${{ matrix.extra-title }}
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental }}
services:
elggdb:
image: ${{ matrix.db-image }}
env:
MYSQL_DATABASE: elgg
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
memcached:
image: memcached:1.6
ports:
- 11211:11211
redis:
image: redis:6
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
php-versions: ['8.0', '8.1', '8.2']
experimental: [false]
extra-title: ['']
memcache: [0]
db-image: ['mysql:5.7']
redis: [0]
include:
- php-versions: '8.0'
experimental: false
extra-title: '- Memcache'
memcache: 1
db-image: 'mysql:5.7'
redis: 0
- php-versions: '8.0'
experimental: false
extra-title: '- Redis'
memcache: 0
db-image: 'mysql:5.7'
redis: 1
- php-versions: '8.0'
experimental: false
extra-title: ''
memcache: 0
db-image: 'mysql:8.0'
redis: 0
- php-versions: '8.0'
experimental: false
extra-title: ''
memcache: 0
db-image: 'mariadb:10.3'
redis: 0
- php-versions: '8.0'
experimental: false
extra-title: ''
memcache: 0
db-image: 'mariadb:10.6'
redis: 0
env:
ELGG_MEMCACHE: ${{ matrix.memcache }}
ELGG_REDIS: ${{ matrix.redis }}
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: gd,pdo,xml,json,memcached,redis-5.3.7,mysqli,pdo_mysql,libxml,mbstring,intl
ini-values: max_execution_time=180
- name: Code checkout
uses: actions/checkout@v3
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> ${GITHUB_OUTPUT}
- name: Restore Composer Cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Composer install
run: composer install
- name: Install Elgg
run: php ./elgg-cli install --config ./install/cli/testing_app.php --verbose --no-ansi
- name: Enable Elgg plugins
run: |
php ./elgg-cli plugins:activate activity blog bookmarks ckeditor dashboard developers discussions externalpages file friends friends_collections garbagecollector groups invitefriends likes members messageboard messages pages profile reportedcontent search site_notifications system_log tagcloud theme_sandbox thewire uservalidationbyemail web_services custom_index:last --no-ansi
php ./elgg-cli plugins:list --no-ansi
- name: Seed Elgg database
run: php ./elgg-cli database:seed --limit=5 --image_folder=./.scripts/seeder/images/ -vv --no-ansi
- name: Start Elgg webserver
# there is some weird issue with the PHP cli-server in PHP 8.1, so skipping this
if: ${{ !contains(fromJSON('["8.1", "8.2"]'), matrix.php-versions) }}
run: |
php -S localhost:8888 -c ./.scripts/ci/local_php_server.ini index.php &
# give Web server some time to bind to sockets, etc
sleep 3
# check if the webserver is running
curl -s http://localhost:8888/ | tac | tac | grep -q "<title>Elgg CI Site</title>"
- name: Run PHPUnit - Core unit
run: ./vendor/bin/phpunit --testsuite unit
- name: Run PHPUnit - Core integration
run: ./vendor/bin/phpunit --testsuite integration
- name: Run PHPUnit - Plugins unit
run: ./vendor/bin/phpunit --testsuite plugins-unit
- name: Run PHPUnit - Plugins integration
run: ./vendor/bin/phpunit --testsuite plugins-integration
- name: Unseed Elgg database
if: ${{ always() }}
run: php ./elgg-cli database:unseed -vv --no-ansi