-
Notifications
You must be signed in to change notification settings - Fork 40
146 lines (120 loc) · 4.71 KB
/
tests.yaml
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
name: Tests and linting
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
dependencies: ['']
include:
- { php-version: '7.3', dependencies: '--prefer-lowest --prefer-stable' }
name: Unit tests - PHP ${{ matrix.php-version }} ${{ matrix.dependencies }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, zip
coverage: xdebug
- name: Install dependencies
run: composer update --no-interaction ${{ matrix.dependencies }}
- name: Run tests
env:
COLUMNS: 120
run: |
./vendor/bin/phpunit --configuration ./src-tests/phpunit.xml --exclude-group integration --coverage-clover ./src-tests/logs/clover.xml
- name: Submit coverage to Coveralls
if: ${{ matrix.php-version < 8.0 }} # Code coverage on PHP 8 is not supported with PHPUnit 8
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ github.job }}-PHP-${{ matrix.php-version }} ${{ matrix.dependencies }}
run: |
composer global require php-coveralls/php-coveralls
~/.composer/vendor/bin/php-coveralls --coverage_clover=./src-tests/logs/clover.xml --json_path=./src-tests/logs/coveralls-upload.json -v
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
selenium-version: ['3.141.59', '4.23.0']
name: Integration tests (Selenium ${{ matrix.selenium-version }})
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4' # Code coverage on PHP 8 is not supported with PHPUnit 8
extensions: mbstring, intl, zip
coverage: xdebug
- name: Install dependencies
run: composer update --no-interaction
- name: Start Selenium server and Xvfb
env:
SELENIUM_EXTRA_PARAMS: "${{ matrix.selenium-version != '3.141.59' && 'standalone' || '' }}"
run: |
google-chrome --version
chromedriver --version
SELENIUM_JAR=$(bin/steward install --no-interaction --no-ansi ${{ matrix.selenium-version }})
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum java -jar $SELENIUM_JAR $SELENIUM_EXTRA_PARAMS >selenium-server.log &
while ! nc -z localhost 4444 </dev/null; do echo Waiting for Selenium server to start...; sleep 1; done
- name: Run tests
env:
COLUMNS: 120
SELENIUM_SERVER_URL: http://127.0.0.1:4444/wd/hub
run: |
./vendor/bin/phpunit --configuration ./src-tests/phpunit.xml --group integration --coverage-clover ./src-tests/logs/clover.xml
- name: Submit coverage to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ github.job }}-selenium-${{ matrix.selenium-version }}
NO_COLOR: 'true'
run: |
composer global require php-coveralls/php-coveralls
~/.composer/vendor/bin/php-coveralls --coverage_clover=./src-tests/logs/clover.xml --coverage_clover=./src-tests/FunctionalTests/logs/clover.xml --json_path=./src-tests/logs/coveralls-upload.json -v
- name: Dump logs
if: ${{ always() }}
run: |
[ -r selenium-server.log ] && cat selenium-server.log
finish-tests:
name: Tests finished
needs: [unit-tests, integration-tests]
runs-on: ubuntu-latest
steps:
- name: Notify Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
codestyle:
name: "Code style and static analysis"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl
- name: Install dependencies
run: composer update --no-progress
- name: Lint
run: composer lint
- name: Run checks
run: composer analyze
markdown-link-check:
name: "Markdown link check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
config-file: '.github/mlc_config.json'