Skip to content

Commit e352ba1

Browse files
committed
Split jobs
1 parent 52954c7 commit e352ba1

1 file changed

Lines changed: 69 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 69 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,114 @@
11
name: CI
22
on: [pull_request]
33
jobs:
4+
static_analysis:
5+
name: Static analysis
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
10+
- name: Get Composer Cache Directory
11+
id: composer-cache
12+
run: |
13+
echo "::set-output name=dir::$(composer config cache-files-dir)"
14+
15+
- uses: actions/cache@v2
16+
with:
17+
path: ${{ steps.composer-cache.outputs.dir }}
18+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
19+
restore-keys: |
20+
${{ runner.os }}-composer-
21+
22+
- uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: '7.1'
25+
coverage: none
26+
extensions: mongodb, redis, :xdebug
27+
ini-values: memory_limit=2048M
28+
29+
- run: php ./bin/fix-symfony-version.php "4.3.*"
30+
- run: composer install --no-progress
31+
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
32+
- 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 pkg
33+
34+
code_style_check:
35+
name: Code style check
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Get Composer Cache Directory
41+
id: composer-cache
42+
run: |
43+
echo "::set-output name=dir::$(composer config cache-files-dir)"
44+
45+
- uses: actions/cache@v2
46+
with:
47+
path: ${{ steps.composer-cache.outputs.dir }}
48+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
49+
restore-keys: |
50+
${{ runner.os }}-composer-
51+
52+
- uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: '7.1'
55+
coverage: none
56+
extensions: mongodb, redis, :xdebug
57+
ini-values: memory_limit=2048M
58+
59+
- run: php ./bin/fix-symfony-version.php "4.3.*"
60+
- run: composer install --no-progress
61+
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
62+
- run: ./bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff -v
63+
464
tests:
565
runs-on: ubuntu-latest
666
strategy:
767
matrix:
868
php: ['7.4']
969
symfony_version: ['4.3.*']
1070
experimental: [false]
11-
stan: [false]
12-
cs_fixer: [false]
13-
unit_tests: [false]
71+
unit_tests: [true]
1472
functional_tests: [false]
1573
prepare_container: [false]
1674
rdkafka_tests: [false]
1775
include:
1876
- php: 7.1
1977
symfony_version: 4.3.*
20-
stan: true
21-
- php: 7.1
22-
symfony_version: 4.3.*
23-
cs_fixer: true
24-
- php: 7.1
25-
symfony_version: 4.3.*
26-
unit_tests: true
2778
- php: 7.2
2879
symfony_version: 4.3.*
29-
unit_tests: true
3080
- php: 7.2
3181
symfony_version: 5.0.*
32-
unit_tests: true
3382
- php: 7.3
3483
symfony_version: 4.3.*
35-
unit_tests: true
3684
- php: 7.3
3785
symfony_version: 4.4.*
38-
unit_tests: true
3986
- php: 7.3
4087
symfony_version: 5.0.*
41-
unit_tests: true
4288
- php: 7.4
4389
symfony_version: 4.3.*
44-
unit_tests: true
4590
- php: 7.4
4691
symfony_version: 4.4.*
47-
unit_tests: true
4892
- php: 7.4
4993
symfony_version: 5.0.*
50-
unit_tests: true
5194
- php: 7.1
5295
symfony_version: 4.3.*
96+
unit_tests: false
5397
functional_tests: true
5498
prepare_container: true
5599
- php: 7.3
56100
symfony_version: 5.0.*
101+
unit_tests: false
57102
functional_tests: true
58103
prepare_container: true
59104
- php: 7.1
60105
symfony_version: 4.3.*
106+
unit_tests: false
61107
rdkafka_tests: true
62108
prepare_container: true
63109
experimental: true
64110

65-
name: PHP ${{ matrix.php }} tests on Sf ${{ matrix.symfony_version }}, phpstan=${{ matrix.stan }}, cs=${{ matrix.cs_fixer }}, unit=${{ matrix.unit_tests }}, func=${{ matrix.functional_tests }}, rdkafka=${{ matrix.rdkafka_tests }}
111+
name: PHP ${{ matrix.php }} tests on Sf ${{ matrix.symfony_version }}, unit=${{ matrix.unit_tests }}, func=${{ matrix.functional_tests }}, rdkafka=${{ matrix.rdkafka_tests }}
66112

67113
steps:
68114
- uses: actions/checkout@v2
@@ -93,19 +139,13 @@ jobs:
93139
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
94140

95141
- run: bin/dev -b
96-
if: ${{ matrix.prepare_container == true }}
97-
98-
- run: ./bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff -v
99-
if: ${{ matrix.cs_fixer == true }}
100-
101-
- 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 pkg
102-
if: ${{ matrix.stan == true }}
142+
if: matrix.prepare_container
103143

104144
- run: bin/phpunit --exclude-group=functional
105-
if: ${{ matrix.unit_tests == true }}
145+
if: matrix.unit_tests
106146

107147
- run: bin/test.sh --exclude-group=rdkafka
108-
if: ${{ matrix.functional_tests == true }}
148+
if: matrix.functional_tests
109149

110150
- run: bin/test.sh --group=rdkafka
111-
if: ${{ matrix.rdkafka_tests == true }}
151+
if: matrix.rdkafka_tests

0 commit comments

Comments
 (0)