-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 2.94 KB
/
Copy pathtest.yml
File metadata and controls
63 lines (51 loc) · 2.94 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
name: Test
on: [push]
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.1']
symfony-versions: ['4.4.*', '5.4.*']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} with Symfony ${{ matrix.symfony-versions }}
steps:
# —— Setup Github actions 🐙 —————————————————————————————————————————————
- name: Checkout
uses: actions/checkout@v2
# https://github.com/shivammathur/setup-php (community)
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
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 "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
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-versions }}-${{ matrix.symfony-versions }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ matrix.symfony-versions }}-
- name: Validate Composer.json
run: composer validate
- name: Fix symfony version for symfony/framework-bundle
run: composer require --no-update symfony/framework-bundle:"${{ matrix.symfony-versions }}";
- name: Fix symfony version for symfony/console
run: composer require --no-update symfony/console:"${{ matrix.symfony-versions }}";
- name: Install Composer dependencies
run: composer update --no-progress --no-suggest --prefer-dist --optimize-autoloader
## —— Test ✅ ———————————————————————————————————————————————————————————
- name: Run Tests
run: php bin/phpunit --coverage-text