Skip to content

Commit daa9753

Browse files
committed
Add GH action CI
1 parent 9010c31 commit daa9753

1 file changed

Lines changed: 105 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
tests:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
php: ['7.1', '7.2', '7.3', '7.4']
9+
experimental: [false]
10+
include:
11+
- php: 7.1
12+
symfony_version: 4.3.*
13+
phpstan: true
14+
- php: 7.1
15+
symfony_version: 4.3.*
16+
php_cs_fixer: true
17+
- php: 7.1
18+
symfony_version: 4.3.*
19+
unit_tests: true
20+
- php: 7.2
21+
symfony_version: 4.3.*
22+
unit_tests: true
23+
- php: 7.2
24+
symfony_version: 5.0.*
25+
unit_tests: true
26+
- php: 7.3
27+
symfony_version: 4.3.*
28+
unit_tests: true
29+
- php: 7.3
30+
symfony_version: 4.4.*
31+
unit_tests: true
32+
- php: 7.3
33+
symfony_version: 5.0.*
34+
unit_tests: true
35+
- php: 7.4
36+
symfony_version: 4.3.*
37+
unit_tests: true
38+
- php: 7.4
39+
symfony_version: 4.4.*
40+
unit_tests: true
41+
- php: 7.4
42+
symfony_version: 5.0.*
43+
unit_tests: true
44+
- php: 7.1
45+
symfony_version: 4.3.*
46+
functional_tests: true
47+
prepare_container: true
48+
- php: 7.3
49+
symfony_version: 5.0.*
50+
functional_tests: true
51+
prepare_container: true
52+
- php: 7.1
53+
symfony_version: 4.3.*
54+
rdkafka_tests: true
55+
prepare_container: true
56+
experimental: true
57+
name: PHP ${{ matrix.php }} tests on Symfony ${{ matrix.symfony_version }}
58+
env:
59+
SYMFONY_VERSION: ${{ matrix.symfony_version }}
60+
PHPSTAN: ${{ matrix.phpstan }}
61+
PHP_CS_FIXER: ${{ matrix.php_cs_fixer }}
62+
UNIT_TESTS: ${{ matrix.unit_tests }}
63+
FUNCTIONAL_TESTS: ${{ matrix.functional_tests }}
64+
PREPARE_CONTAINER: ${{ matrix.prepare_container }}
65+
RDKAFKA_TESTS: ${{ matrix.rdkafka_tests }}
66+
steps:
67+
- uses: actions/checkout@v2
68+
69+
- uses: actions/cache@v2
70+
with:
71+
path: ~/.composer/cache
72+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
73+
restore-keys: |
74+
${{ runner.os }}-composer-
75+
76+
- uses: shivammathur/setup-php@v2
77+
with:
78+
php-version: ${{ matrix.php }}
79+
coverage: none
80+
extensions: mongodb, redis, :xdebug
81+
ini-values: memory_limit=2048M
82+
83+
- run: php ./bin/fix-symfony-version.php "${{ matrix.symfony_version }}"
84+
85+
- run: composer install
86+
87+
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
88+
89+
- run: bin/dev
90+
if: ${{ matrix.prepare_container == true }}
91+
92+
- run: ./bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff -v --path-mode=intersection
93+
if: ${{ matrix.php_cs_fixer == true }}
94+
95+
- run: docker run --workdir="/mqdev" -v "`pwd`:/mqdev" --rm enqueue/dev:latest php -d memory_limit=1024M bin/phpstan analyse -l 1 -c phpstan.neon
96+
if: ${{ matrix.phpstan == true }}
97+
98+
- run: bin/phpunit --exclude-group=functional
99+
if: ${{ matrix.unit_tests == true }}
100+
101+
- run: bin/test.sh --exclude-group=rdkafka
102+
if: ${{ matrix.functional_tests == true }}
103+
104+
- run: then bin/test.sh --group=rdkafka
105+
if: ${{ matrix.rdkafka == true }}

0 commit comments

Comments
 (0)