-
-
Notifications
You must be signed in to change notification settings - Fork 72
94 lines (77 loc) · 2.82 KB
/
build.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
on:
pull_request:
push:
branches:
- master
name: build
jobs:
tests:
name: PHP ${{ matrix.php }}-sphinx-${{ matrix.sphinx }}-${{ matrix.os }}
env:
extensions: pdo, pdo_mysql
key: cache-v1
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
php:
# - "5.4"
# - "5.5"
# - "5.6"
- "7.0"
# - "7.1"
# - "7.2"
# - "7.3"
# - "7.4"
sphinx:
- "2.2.11"
- "3.5.1"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2
- name: Update composer
run: composer self-update
- name: Install dependencies with composer php < 8.0
if: matrix.php != '8.0'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Install dependencies with composer php 8.0
if: matrix.php == '8.0'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Install sphinx
run: sh tests/data/actions/sphinx-setup-${{ matrix.sphinx }}.sh
- name: Setup source database
run: |
sudo systemctl start mysql.service
mysql -uroot -proot -e 'USE mysql;ALTER USER "root"@"localhost" IDENTIFIED WITH mysql_native_password BY "root";FLUSH PRIVILEGES;'
mysql -uroot -proot -e 'CREATE DATABASE `yiitest`;'
mysql -D yiitest -uroot -proot < tests/data/source.sql
- name: Run sphinx 2.2.11
if: matrix.sphinx == '2.2.11'
run: |
indexer --config tests/data/sphinx-${{ matrix.sphinx }}.conf --all
searchd --config tests/data/sphinx-${{ matrix.sphinx }}.conf
- name: Run sphinx 3
if: matrix.sphinx != '2.2.11'
run: |
/opt/sphinx/sphinx-${{ matrix.sphinx }}/bin/indexer --config tests/data/sphinx-${{ matrix.sphinx }}.conf --all
/opt/sphinx/sphinx-${{ matrix.sphinx }}/bin/searchd --config tests/data/sphinx-${{ matrix.sphinx }}.conf
- name: Run tests with phpunit
if: matrix.php != '7.4'
run: vendor/bin/phpunit --colors=always
- name: Run tests with phpunit
if: matrix.php == '7.4'
run: vendor/bin/phpunit --coverage-clover=clover.xml --colors=always
- name: Upload code coverage scrutinizer
if: matrix.php == '7.4'
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover