-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (79 loc) · 2.25 KB
/
php-lib-ci.yml
File metadata and controls
83 lines (79 loc) · 2.25 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Continuous integration - PHP lib
on:
workflow_call:
inputs:
extra-extensions:
type: string
required: false
default: ''
description: 'Extra PHP Extensions to install, besides the default ones'
tests:
type: boolean
required: false
default: true
description: 'Enables execution of unit tests when value is true. Defaults to true'
jobs:
static-analysis:
runs-on: ubuntu-24.04
strategy:
matrix:
php-version: ['8.4']
command: ['cs', 'stan']
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: ${{ inputs.extra-extensions }}
coverage: none
- run: composer install --no-interaction --prefer-dist
- run: composer ${{ matrix.command }}
unit-tests:
if: ${{ inputs.tests }}
runs-on: ubuntu-24.04
strategy:
matrix:
php-version: ['8.4', '8.5']
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: ${{ inputs.extra-extensions }}
coverage: xdebug
- run: composer install --no-interaction --prefer-dist
- run: composer test:ci
- uses: actions/cache/save@v4
if: ${{ matrix.php-version == '8.4' }}
with:
path: build
key: build-${{ matrix.php-version }}-${{ github.run_id }}
upload-coverage:
needs:
- unit-tests
runs-on: ubuntu-24.04
strategy:
matrix:
php-version: ['8.4']
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
- uses: actions/cache/restore@v4
with:
key: build-${{ matrix.php-version }}-${{ github.run_id }}
path: build
- name: Publish coverage
uses: codecov/codecov-action@v5
with:
files: ./build/clover.xml