|
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_VERSION }} |
13 | | - runs-on: ubuntu-latest |
| 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 | | - include: |
18 | | - - PHP_VERSION: '7.1' |
19 | | - SYMFONY_REQUIRE: '^3.4' |
20 | | - - PHP_VERSION: '7.2' |
21 | | - SYMFONY_REQUIRE: '^4.4' |
22 | | - - PHP_VERSION: '7.3' |
23 | | - SYMFONY_REQUIRE: '^5.0' |
24 | | - - PHP_VERSION: '7.4' |
25 | | - SYMFONY_REQUIRE: '^5.2' |
26 | | - - PHP_VERSION: '8.0' |
27 | | - SYMFONY_REQUIRE: '^5.3' |
28 | | - - PHP_VERSION: '8.0' |
29 | | - SYMFONY_REQUIRE: '^6.0' |
| 19 | + php-version: |
| 20 | + - '8.2' |
30 | 21 |
|
31 | 22 | steps: |
32 | | - # —— Setup Github actions 🐙 ————————————————————————————————————————————— |
33 | | - # https://github.com/actions/checkout (official) |
34 | 23 | - |
35 | | - name: Checkout |
36 | | - uses: actions/checkout@v2 |
| 24 | + name: 'Check out' |
| 25 | + uses: 'actions/checkout@v4' |
37 | 26 |
|
38 | | - # https://github.com/shivammathur/setup-php (community) |
39 | 27 | - |
40 | | - name: Setup PHP, extensions and composer with shivammathur/setup-php |
41 | | - uses: shivammathur/setup-php@v2 |
| 28 | + name: 'Set up PHP' |
| 29 | + uses: 'shivammathur/setup-php@v2' |
42 | 30 | with: |
43 | | - php-version: ${{ matrix.PHP_VERSION }} |
44 | | - extensions: mbstring, ctype, iconv, bcmath, filter, json |
45 | | - coverage: none |
46 | | - env: |
47 | | - update: true |
| 31 | + php-version: '${{ matrix.php-version }}' |
| 32 | + coverage: 'none' |
48 | 33 |
|
49 | | - # —— Composer 🧙️ ————————————————————————————————————————————————————————— |
50 | 34 | - |
51 | | - name: Install Composer dependencies |
52 | | - env: |
53 | | - SYMFONY_REQUIRE: ${{ matrix.SYMFONY_REQUIRE }} |
54 | | - SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1 |
55 | | - SYMFONY_PHPUNIT_VERSION: '7.5.6' |
56 | | - run: | |
57 | | - git config --global author.name Sebastiaan Stok |
58 | | - git config --global author.email s.stok@rollerscapes.net |
59 | | - git config --global user.name Sebastiaan Stok |
60 | | - git config --global user.email s.stok@rollerscapes.net |
| 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-' |
61 | 46 |
|
62 | | - rm -f composer.lock |
63 | | - composer install --no-progress --no-interaction --optimize-autoloader --ansi |
| 47 | + - |
| 48 | + name: 'Install dependencies' |
| 49 | + run: 'composer install --no-progress' |
64 | 50 |
|
65 | | - ## —— Tests ✅ ——————————————————————————————————————————————————————————— |
66 | 51 | - |
67 | | - name: Run Tests |
68 | | - run: | |
69 | | - make test |
70 | | - lint: |
71 | | - name: PHP-QA |
72 | | - runs-on: ubuntu-latest |
| 52 | + name: 'Check the code style' |
| 53 | + run: 'make cs' |
| 54 | + |
| 55 | + phpstan: |
| 56 | + name: 'PhpStan' |
| 57 | + |
| 58 | + runs-on: 'ubuntu-latest' |
| 59 | + |
73 | 60 | strategy: |
74 | | - fail-fast: false |
| 61 | + matrix: |
| 62 | + php-version: |
| 63 | + - '8.2' |
| 64 | + |
75 | 65 | steps: |
76 | 66 | - |
77 | | - name: Checkout |
78 | | - uses: actions/checkout@v2 |
| 67 | + name: 'Check out' |
| 68 | + uses: 'actions/checkout@v4' |
79 | 69 |
|
80 | | - # https://github.com/shivammathur/setup-php (community) |
81 | 70 | - |
82 | | - name: Setup PHP, extensions and composer with shivammathur/setup-php |
83 | | - uses: shivammathur/setup-php@v2 |
| 71 | + name: 'Set up PHP' |
| 72 | + uses: 'shivammathur/setup-php@v2' |
84 | 73 | with: |
85 | | - php-version: '7.4' |
86 | | - extensions: mbstring, ctype, iconv, bcmath, filter, json |
87 | | - coverage: none |
| 74 | + php-version: '${{ matrix.php-version }}' |
| 75 | + coverage: 'none' |
88 | 76 |
|
89 | | - # —— Composer 🧙️ ————————————————————————————————————————————————————————— |
90 | 77 | - |
91 | | - name: Install Composer dependencies |
92 | | - run: | |
93 | | - rm -f composer.lock |
94 | | - composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --ansi |
| 78 | + name: 'Get Composer cache directory' |
| 79 | + id: 'composer-cache' |
| 80 | + run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' |
| 81 | + |
| 82 | + - |
| 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' |
95 | 93 |
|
96 | 94 | - |
97 | | - name: Run PHP-QA |
| 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' |
| 147 | + env: |
| 148 | + COMPOSER_OPTIONS: '${{ matrix.composer-options }}' |
| 149 | + SYMFONY_REQUIRE: '${{ matrix.symfony-version }}' |
98 | 150 | run: | |
99 | | - make cs-full |
| 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 |
| 154 | +
|
| 155 | + - |
| 156 | + name: 'Run tests' |
| 157 | + run: make phpunit |
0 commit comments