-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (79 loc) · 3 KB
/
verify.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
name: Verify
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: '20 4 * * *'
jobs:
test:
name: Run E2E tests (PHP ${{ matrix.version.php }}, MySQL ${{ matrix.version.mysql }})
runs-on: ubuntu-latest
strategy:
matrix:
version:
- mysql: "5.7"
php: "5.6"
- mysql: "8.0"
php: "7.4"
- mysql: "8.0"
php: "8.1"
services:
mysql:
image: mysql:${{ matrix.version.mysql }}
ports:
- "3306:3306"
env:
MYSQL_DATABASE: yaronet
MYSQL_ROOT_PASSWORD: yaronet
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install PPA repository
run: sudo add-apt-repository ppa:ondrej/php
- name: Update package sources
run: sudo apt-get update
- name: Install packages
run: >
sudo apt-get install
apache2
libapache2-mod-php${{ matrix.version.php }}
php${{ matrix.version.php }}-curl
php${{ matrix.version.php }}-gd
php${{ matrix.version.php }}-mbstring
php${{ matrix.version.php }}-mcrypt
php${{ matrix.version.php }}-mysql
php${{ matrix.version.php }}-xml
- name: Enable Apache rewrite module
run: sudo a2enmod -q rewrite
- name: Copy Apache configuration file
run: sudo cp -f setup/ci/apache.conf /etc/apache2/sites-available/000-default.conf
- name: Update Apache configuration
run: sudo sed -e "s?%CI_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- name: Update PHP configuration
run: sudo sed -ri 's/^(zend\.assertions)[[:blank:]]*=.*/\1 = 1/' '/etc/php/${{ matrix.version.php }}/apache2/php.ini'
- name: Allow traversing to current directory
run: |
directory="$(pwd)"
while [[ "$directory" != / ]]; do
sudo chmod +x "$directory"
directory="$(dirname "$directory")"
done
- name: Start Apache
run: sudo service apache2 restart
- name: Initialize MySQL database
run: sudo mysql --host=127.0.0.1 --user=root --password=yaronet yaronet < setup/database/schema.sql
- name: Setup environment
run: sh setup/configure.sh
- name: Enable write access on src directory
run: sudo chown -R www-data:www-data .
- name: Initialize yAronet
run: curl -f -s -d 'meta_admin_login=test&meta_admin_password=test&engine_network_http_insecure=1&engine_network_sql_connection=mysqli%3A%2F%2Froot%3Ayaronet%40127.0.0.1%2Fyaronet%3Fcharset%3Dutf8mb4&engine_network_route_page=%2Fsrc&engine_system_encoding_charset=utf-8&version=1' -o /dev/null http://127.0.0.1/src/install.php
- name: Check configuration file
run: test -f src/config.php
- name: Run test suite
run: curl -s http://127.0.0.1/test/ | tee /tmp/run.log | grep -Fq 'test suite stop.' || ( cat /tmp/run.log && false )