|
1 | 1 | name: CI |
2 | 2 | on: [pull_request] |
3 | 3 | 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 | + |
4 | 64 | tests: |
5 | 65 | runs-on: ubuntu-latest |
6 | 66 | strategy: |
7 | 67 | matrix: |
8 | 68 | php: ['7.4'] |
9 | 69 | symfony_version: ['4.3.*'] |
10 | 70 | experimental: [false] |
11 | | - stan: [false] |
12 | | - cs_fixer: [false] |
13 | | - unit_tests: [false] |
| 71 | + unit_tests: [true] |
14 | 72 | functional_tests: [false] |
15 | 73 | prepare_container: [false] |
16 | 74 | rdkafka_tests: [false] |
17 | 75 | include: |
18 | 76 | - php: 7.1 |
19 | 77 | 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 |
27 | 78 | - php: 7.2 |
28 | 79 | symfony_version: 4.3.* |
29 | | - unit_tests: true |
30 | 80 | - php: 7.2 |
31 | 81 | symfony_version: 5.0.* |
32 | | - unit_tests: true |
33 | 82 | - php: 7.3 |
34 | 83 | symfony_version: 4.3.* |
35 | | - unit_tests: true |
36 | 84 | - php: 7.3 |
37 | 85 | symfony_version: 4.4.* |
38 | | - unit_tests: true |
39 | 86 | - php: 7.3 |
40 | 87 | symfony_version: 5.0.* |
41 | | - unit_tests: true |
42 | 88 | - php: 7.4 |
43 | 89 | symfony_version: 4.3.* |
44 | | - unit_tests: true |
45 | 90 | - php: 7.4 |
46 | 91 | symfony_version: 4.4.* |
47 | | - unit_tests: true |
48 | 92 | - php: 7.4 |
49 | 93 | symfony_version: 5.0.* |
50 | | - unit_tests: true |
51 | 94 | - php: 7.1 |
52 | 95 | symfony_version: 4.3.* |
| 96 | + unit_tests: false |
53 | 97 | functional_tests: true |
54 | 98 | prepare_container: true |
55 | 99 | - php: 7.3 |
56 | 100 | symfony_version: 5.0.* |
| 101 | + unit_tests: false |
57 | 102 | functional_tests: true |
58 | 103 | prepare_container: true |
59 | 104 | - php: 7.1 |
60 | 105 | symfony_version: 4.3.* |
| 106 | + unit_tests: false |
61 | 107 | rdkafka_tests: true |
62 | 108 | prepare_container: true |
63 | 109 | experimental: true |
64 | 110 |
|
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 }} |
66 | 112 |
|
67 | 113 | steps: |
68 | 114 | - uses: actions/checkout@v2 |
@@ -93,19 +139,13 @@ jobs: |
93 | 139 | - run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php |
94 | 140 |
|
95 | 141 | - 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 |
103 | 143 |
|
104 | 144 | - run: bin/phpunit --exclude-group=functional |
105 | | - if: ${{ matrix.unit_tests == true }} |
| 145 | + if: matrix.unit_tests |
106 | 146 |
|
107 | 147 | - run: bin/test.sh --exclude-group=rdkafka |
108 | | - if: ${{ matrix.functional_tests == true }} |
| 148 | + if: matrix.functional_tests |
109 | 149 |
|
110 | 150 | - run: bin/test.sh --group=rdkafka |
111 | | - if: ${{ matrix.rdkafka_tests == true }} |
| 151 | + if: matrix.rdkafka_tests |
0 commit comments