|
1 |
| -name: Full CI process |
| 1 | +name: 'CI' |
| 2 | + |
2 | 3 | on:
|
3 | 4 | push:
|
4 | 5 | branches:
|
|
8 | 9 | - main
|
9 | 10 |
|
10 | 11 | jobs:
|
11 |
| - test: |
12 |
| - name: PHP ${{ matrix.php-versions }} |
13 |
| - runs-on: ubuntu-18.04 |
| 12 | + cs-fixer: |
| 13 | + name: 'PHP CS Fixer' |
| 14 | + |
| 15 | + runs-on: 'ubuntu-latest' |
| 16 | + |
14 | 17 | strategy:
|
15 |
| - fail-fast: false |
16 | 18 | matrix:
|
17 |
| - php-versions: [ '7.2', '7.3', '7.4', '8.0' ] |
| 19 | + php-version: |
| 20 | + - '8.2' |
18 | 21 |
|
19 | 22 | steps:
|
20 |
| - # —— Setup Github actions 🐙 ————————————————————————————————————————————— |
21 |
| - # https://github.com/actions/checkout (official) |
22 | 23 | -
|
23 |
| - name: Checkout |
24 |
| - uses: actions/checkout@v2 |
| 24 | + name: 'Check out' |
| 25 | + uses: 'actions/checkout@v4' |
25 | 26 |
|
26 |
| - # https://github.com/shivammathur/setup-php (community) |
27 | 27 | -
|
28 |
| - name: Setup PHP, extensions and composer with shivammathur/setup-php |
29 |
| - uses: shivammathur/setup-php@v2 |
| 28 | + name: 'Set up PHP' |
| 29 | + uses: 'shivammathur/setup-php@v2' |
30 | 30 | with:
|
31 |
| - php-version: ${{ matrix.php-versions }} |
32 |
| - extensions: mbstring, ctype, iconv, bcmath, filter, json |
33 |
| - coverage: none |
34 |
| - env: |
35 |
| - update: true |
| 31 | + php-version: '${{ matrix.php-version }}' |
| 32 | + coverage: 'none' |
| 33 | + |
| 34 | + - |
| 35 | + name: 'Get Composer cache directory' |
| 36 | + id: 'composer-cache' |
| 37 | + run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' |
| 38 | + |
| 39 | + - |
| 40 | + name: 'Cache dependencies' |
| 41 | + uses: 'actions/cache@v3' |
| 42 | + with: |
| 43 | + path: '${{ steps.composer-cache.outputs.cache_dir }}' |
| 44 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 45 | + restore-keys: 'php-${{ matrix.php-version }}-composer-locked-' |
| 46 | + |
| 47 | + - |
| 48 | + name: 'Install dependencies' |
| 49 | + run: 'composer install --no-progress' |
| 50 | + |
| 51 | + - |
| 52 | + name: 'Check the code style' |
| 53 | + run: 'make cs' |
| 54 | + |
| 55 | + phpstan: |
| 56 | + name: 'PhpStan' |
| 57 | + |
| 58 | + runs-on: 'ubuntu-latest' |
| 59 | + |
| 60 | + strategy: |
| 61 | + matrix: |
| 62 | + php-version: |
| 63 | + - '8.2' |
| 64 | + |
| 65 | + steps: |
| 66 | + - |
| 67 | + name: 'Check out' |
| 68 | + uses: 'actions/checkout@v4' |
| 69 | + |
| 70 | + - |
| 71 | + name: 'Set up PHP' |
| 72 | + uses: 'shivammathur/setup-php@v2' |
| 73 | + with: |
| 74 | + php-version: '${{ matrix.php-version }}' |
| 75 | + coverage: 'none' |
| 76 | + |
| 77 | + - |
| 78 | + name: 'Get Composer cache directory' |
| 79 | + id: 'composer-cache' |
| 80 | + run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' |
36 | 81 |
|
37 |
| - # —— Composer 🧙️ ————————————————————————————————————————————————————————— |
38 | 82 | -
|
39 |
| - name: Install Composer dependencies |
| 83 | + name: 'Cache dependencies' |
| 84 | + uses: 'actions/cache@v3' |
| 85 | + with: |
| 86 | + path: '${{ steps.composer-cache.outputs.cache_dir }}' |
| 87 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 88 | + restore-keys: 'php-${{ matrix.php-version }}-composer-locked-' |
| 89 | + |
| 90 | + - |
| 91 | + name: 'Install dependencies' |
| 92 | + run: 'composer install --no-progress' |
| 93 | + |
| 94 | + - |
| 95 | + name: 'Run PhpStan' |
| 96 | + run: 'vendor/bin/phpstan analyze --no-progress' |
| 97 | + |
| 98 | + tests: |
| 99 | + name: 'PHPUnit' |
| 100 | + |
| 101 | + runs-on: 'ubuntu-latest' |
| 102 | + |
| 103 | + strategy: |
| 104 | + matrix: |
| 105 | + include: |
| 106 | + - |
| 107 | + php-version: '8.2' |
| 108 | + composer-options: '--prefer-stable' |
| 109 | + symfony-version: '6.3' |
| 110 | + - |
| 111 | + php-version: '8.2' |
| 112 | + composer-options: '--prefer-stable' |
| 113 | + symfony-version: '^6.4' |
| 114 | + |
| 115 | + - |
| 116 | + php-version: '8.2' |
| 117 | + composer-options: '--prefer-stable' |
| 118 | + symfony-version: '^7.0' |
| 119 | + |
| 120 | + steps: |
| 121 | + - |
| 122 | + name: 'Check out' |
| 123 | + uses: 'actions/checkout@v4' |
| 124 | + |
| 125 | + - |
| 126 | + name: 'Set up PHP' |
| 127 | + uses: 'shivammathur/setup-php@v2' |
| 128 | + with: |
| 129 | + php-version: '${{ matrix.php-version }}' |
| 130 | + coverage: 'none' |
| 131 | + |
| 132 | + - |
| 133 | + name: 'Get Composer cache directory' |
| 134 | + id: 'composer-cache' |
| 135 | + run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' |
| 136 | + |
| 137 | + - |
| 138 | + name: 'Cache dependencies' |
| 139 | + uses: 'actions/cache@v3' |
| 140 | + with: |
| 141 | + path: '${{ steps.composer-cache.outputs.cache_dir }}' |
| 142 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 143 | + restore-keys: 'php-${{ matrix.php-version }}-composer-locked-' |
| 144 | + |
| 145 | + - |
| 146 | + name: 'Install dependencies' |
40 | 147 | env:
|
41 |
| - SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1 |
| 148 | + COMPOSER_OPTIONS: '${{ matrix.composer-options }}' |
| 149 | + SYMFONY_REQUIRE: '${{ matrix.symfony-version }}' |
42 | 150 | run: |
|
43 |
| - make install |
| 151 | + composer global config --no-plugins allow-plugins.symfony/flex true |
| 152 | + composer global require --no-progress --no-scripts --no-plugins symfony/flex |
| 153 | + composer update --no-progress $COMPOSER_OPTIONS |
44 | 154 |
|
45 |
| - ## —— Tests ✅ ——————————————————————————————————————————————————————————— |
46 | 155 | -
|
47 |
| - name: Run Tests |
48 |
| - run: | |
49 |
| - make test |
50 |
| -# lint: |
51 |
| -# name: PHP-QA |
52 |
| -# runs-on: ubuntu-latest |
53 |
| -# strategy: |
54 |
| -# fail-fast: false |
55 |
| -# steps: |
56 |
| -# - |
57 |
| -# name: Checkout |
58 |
| -# uses: actions/checkout@v2 |
59 |
| -# |
60 |
| -# # https://github.com/shivammathur/setup-php (community) |
61 |
| -# - |
62 |
| -# name: Setup PHP, extensions and composer with shivammathur/setup-php |
63 |
| -# uses: shivammathur/setup-php@v2 |
64 |
| -# with: |
65 |
| -# php-version: '7.4' |
66 |
| -# extensions: mbstring, ctype, iconv, bcmath, filter, json |
67 |
| -# coverage: none |
68 |
| -# |
69 |
| -# # —— Composer 🧙️ ————————————————————————————————————————————————————————— |
70 |
| -# - |
71 |
| -# name: Install Composer dependencies |
72 |
| -# run: | |
73 |
| -# make install |
74 |
| -# |
75 |
| -# - |
76 |
| -# name: Run PHP-QA |
77 |
| -# run: | |
78 |
| -# make check |
| 156 | + name: 'Run tests' |
| 157 | + run: make phpunit |
0 commit comments