-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (45 loc) · 1.43 KB
/
main.yaml
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
name: PHP test
on:
push:
pull_request:
repository_dispatch:
types: [ push ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.2']
composer-flags: ['', '--prefer-lowest']
experimental: [false]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit-bridge
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql, mongodb
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer update ${{ matrix.composer-flags }}
- name: Code Style
run: |
export PHP_CS_FIXER_IGNORE_ENV=1
vendor/bin/php-cs-fixer fix src --dry-run
- name: PHPUnit
run: |
vendor/bin/phpunit