-
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.64 KB
/
ci.yaml
File metadata and controls
59 lines (49 loc) · 1.64 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
name: PHP CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
quality-and-test:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true # upgrade 24 (it was weird!)
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug # Enable Xdebug for coverage
- name: Get Composer cache dir
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache Composer
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-php-${{ matrix.php }}-
composer-${{ runner.os }}-
- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
- name: PHP CS
run: vendor/bin/phpcs
- name: PHPStan
run: vendor/bin/phpstan analyse
- name: PHPUnit with Coverage
run: vendor/bin/phpunit --coverage-clover=./.tmp/phpunit/coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ArrayIterator/credit-card
files: ./.tmp/phpunit/coverage.xml
fail_ci_if_error: false
verbose: true