-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.36 KB
/
ci.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
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
name: CI
on:
- pull_request
- push
jobs:
analyse:
runs-on: ubuntu-latest
env:
PHP_CS_FIXER_IGNORE_ENV: 1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
- name: Install dependencies
run: composer update --no-progress
- name: Analyse
run: composer self-update --preview; composer analyse
test:
name: PHP ${{ matrix.php-version }} ${{ matrix.description }}
strategy:
fail-fast: false
matrix:
include:
- description: 'with lowest dependencies'
os: ubuntu-latest
php-version: '7.4'
composer-flags: '--prefer-lowest'
- os: ubuntu-latest
php-version: '7.4'
- os: ubuntu-latest
php-version: '8.1'
- description: on macOS
os: macos-latest
php-version: '8.1'
- description: on Windows
os: windows-latest
php-version: '8.1'
- os: ubuntu-latest
php-version: '8.2'
composer-flags: '--ignore-platform-reqs'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
- 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@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-
- name: Install dependencies
run: composer update --no-progress ${{ matrix.composer-flags }}
- name: Test
run: composer test -- --coverage-clover=./build/logs/clover.xml
- name: Upload coverage results to Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.1'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=./build/logs/clover.xml --verbose