forked from ngnpope/twitter-text-php
-
Notifications
You must be signed in to change notification settings - Fork 21
91 lines (77 loc) · 2.45 KB
/
ci.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: UnitTest & Lint
on:
push:
branches:
- master
- develop
pull_request:
branches:
- '*'
schedule:
- cron: "0 7 1 * *"
branches:
- master
jobs:
testsuite:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
coverage: ['no']
test-tld: ['no']
include:
- php-version: '8.2'
coverage: 'coverage'
test-tld: 'no'
- php-version: '8.2'
coverage: 'no'
test-tld: 'test-tld'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist
- name: Setup problem matchers for PHPUnit
if: matrix.php-version == '8.1' || matrix.php-version == '8.2'
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run PHPUnit
run: |
if [[ ${{ matrix.coverage }} == 'coverage' ]]; then
vendor/bin/phpunit --exclude-group deprecated,tld --stderr --verbose --coverage-clover=coverage.xml
elif [[ ${{ matrix.test-tld }} == 'test-tld' ]]; then
vendor/bin/phpunit --group tld --stderr
else
vendor/bin/phpunit --exclude-group deprecated,tld --stderr
fi
- name: Submit code coverage
if: matrix.coverage == 'coverage'
uses: codecov/codecov-action@v1
codestyle:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, intl, apcu
coverage: none
tools: cs2pr, phpcs
- name: Run PHP CodeSniffer
run: phpcs -qn --report=checkstyle --extensions=php --standard=PSR12 ./lib ./tests | cs2pr