-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (59 loc) · 2.58 KB
/
test.yml
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
name: Build & Test
on:
- push
- pull_request
jobs:
build:
name: Build (PHP ${{ matrix.php-version }} - Composer ${{ matrix.composer-version}})
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
composer-version:
- v2
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP (${{ matrix.php-version }} - Composer ${{ matrix.composer-version}} - Xdebug)
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: uopz, xdebug
ini-values: uopz.exit=1
tools: composer:${{ matrix.composer-version}}
coverage: xdebug
env:
fail-fast: true
- name: Create Directory (./var/build)
run: mkdir -p ./var/build
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-dir)"
- name: Cache Composer
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-build-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-build-composer-
- name: Composer Install (unlocked)
run: |
rm -f ./composer.lock
composer install
- name: PHP Version Compatibility
run: ./vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion ${{ matrix.php-version }} ./src ./tests
- name: Static Analysis (Psalm)
run: ./vendor/bin/psalm --php-version=${{ matrix.php-version }}
- name: Run PHPUnit
run: ./vendor/bin/phpunit --coverage-clover ./var/build/coverage.xml
- name: Code Coverage Check
run: ./vendor/bin/coverage-check ./var/build/coverage.xml 100
- name: Coveralls Coverage Upload
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./vendor/bin/php-coveralls -x ./var/build/coverage.xml -o ./var/build/coveralls-upload.json -v
- name: Validate Code Style
run: ./vendor/bin/phpcs -s