-
Notifications
You must be signed in to change notification settings - Fork 49
92 lines (77 loc) · 2.26 KB
/
tests.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
name: CI
on:
push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
env:
MINK_HOST: '127.0.0.1:8002'
jobs:
tests:
name: Tests (PHP ${{ matrix.php }}, Node ${{ matrix.node }}, Zombie ${{ matrix.zombie }} )
runs-on: ubuntu-20.04
strategy:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
zombie: [ '@^5.0' ]
node: [ '16' ]
include:
- php: '7.4'
node: '5'
zombie: '@^3.0'
- php: '7.4'
node: '10'
zombie: '@^4.0'
- php: '7.2'
node: '5'
zombie: '@^2.0'
fail-fast: false
env:
MATRIX_PHP: ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "xdebug"
php-version: "${{ matrix.php }}"
tools: composer
# PHP 7.1 development web server segfaults if timezone not set.
ini-values: date.timezone=Europe/Paris, error_reporting=-1, display_errors=On
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node }}"
- name: Install dependencies
run: |
composer update --no-interaction --prefer-dist
- name: Install Zombie
run: |
npm install zombie${{ matrix.zombie }}
- name: Setup Mink test server
run: |
mkdir ./logs
./vendor/bin/mink-test-server &> ./logs/mink-test-server.log &
- name: Wait for browser & PHP to start
run: |
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
- name: Run tests
run: |
vendor/bin/phpunit -v --coverage-clover=coverage.clover
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.clover
- name: Archive logs artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: logs_php-${{ matrix.php }}_zombie${{ matrix.zombie }}_node-${{ matrix.node }}
path: |
logs