-
Notifications
You must be signed in to change notification settings - Fork 250
146 lines (118 loc) · 3.92 KB
/
ci.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
144
145
146
name: Tests
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
sf_version: ['3.4.*', '4.4.*', '5.0.*', '6.4.*', '7.0.*']
steps:
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
tools: flex
- name: Checkout code
uses: actions/checkout@v2
- name: Download dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
- name: Run tests
run: ./vendor/bin/phpunit --testsuite Unit
build71:
name: Build PHP 7.1
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
sf_version: ['3.4.*', '4.4.*']
steps:
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: 7.1
tools: flex
- name: Checkout code
uses: actions/checkout@v2
- name: Download dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
- name: Run tests
run: ./vendor/bin/phpunit --testsuite Unit
integration:
name: Integration tests
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
sf_version: ['3.4.*', '4.4.*', '5.0.*']
steps:
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: 7.3
coverage: xdebug
tools: flex
- name: Checkout code
uses: actions/checkout@v2
- name: Download dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
- name: Start servers
run: |
docker build -t buzz/tests .
docker run -d -p 127.0.0.1:8022:80 buzz/tests
docker ps -a
./vendor/bin/http_test_server > /dev/null 2>&1 &
- name: Run tests
run: ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
- name: Upload coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.xml || true
h2push:
name: HTTP/2 Server Push
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: 7.4
tools: flex
- name: Checkout code
uses: actions/checkout@v2
- name: Download dependencies
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
- name: Start servers
run: |
docker network create -d bridge buzz-bridge
docker build -t buzz/tests .
docker run -d --net buzz-bridge --name test-server buzz/tests
docker ps -a
sed -i -e 's/name="TEST_SERVER"/name="FOOBAR"/g' phpunit.xml.dist
- name: Run tests
run: |
docker run --rm --net buzz-bridge -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e BUZZ_TEST_SERVER=http://test-server/index.php php:7.4-cli php vendor/bin/phpunit
lowest:
name: Lowest deps
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: 7.3
tools: flex
- name: Checkout code
uses: actions/checkout@v2
- name: Download dependencies
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable --prefer-lowest
- name: Run tests
env:
SYMFONY_DEPRECATIONS_HELPER: "max[self]=0"
run: ./vendor/bin/phpunit --testsuite Unit