-
Notifications
You must be signed in to change notification settings - Fork 17
83 lines (72 loc) · 3.51 KB
/
test.yml
File metadata and controls
83 lines (72 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Test
on: [push]
jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: 8.0
symfony-version: 4.4.*
stability: prefer-lowest
- php-version: 8.0
symfony-version: 4.4.*
stability: prefer-stable
- php-version: 8.0
symfony-version: 5.4.*
stability: prefer-stable
- php-version: 8.0
symfony-version: 5.4.*
stability: prefer-stable
- php-version: 8.0
symfony-version: 6.0.*
stability: prefer-stable
- php-version: 8.1
symfony-version: 6.2.*
stability: prefer-stable
- php-version: 8.2
symfony-version: 6.2.*
stability: prefer-stable
name: PHP ${{ matrix.php-version }} Test with Symfony ${{ matrix.symfony-version }} and ${{ matrix.stability }}
steps:
# —— Setup Github actions 🐙 —————————————————————————————————————————————
- name: Checkout
uses: actions/checkout@v3
# https://github.com/shivammathur/setup-php (community)
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, iconv, intl
coverage: xdebug #optional
# https://github.com/marketplace/actions/setup-php-action#problem-matchers
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
# https://github.com/marketplace/actions/setup-php-action#problem-matchers
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
# —— Composer 🧙️ —————————————————————————————————————————————————————————
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ matrix.symfony-version }}--${{ matrix.stability }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ matrix.symfony-version }}--${{ matrix.stability }}-
- name: Validate Composer.json
run: composer validate
- name: Install dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins symfony/flex
composer update --no-interaction --prefer-dist --optimize-autoloader --${{ matrix.stability }}
## —— Test ✅ ———————————————————————————————————————————————————————————
- name: Run Tests
run: php bin/phpunit --coverage-text