This repository was archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (90 loc) · 3.06 KB
/
php.yml
File metadata and controls
102 lines (90 loc) · 3.06 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: PHP
on:
pull_request:
push:
branches:
- master
- staging
jobs:
psalm:
name: Static analysis
runs-on: ubuntu-20.04
steps:
- uses: dorny/paths-filter@v2.2.0
id: filter
if: github.event_name == 'pull_request'
with:
filters: |
psalm:
- '**/*.php'
- '**/*.phtml'
- 'psalm.xml'
- '.github/workflows/php.yml'
- name: Checkout repository
if: github.event_name == 'push' || steps.filter.outputs.psalm == 'true'
uses: actions/checkout@v2
- name: Composer cache
uses: actions/cache@v1
id: composer-cache
if: github.event_name == 'push' || steps.filter.outputs.psalm == 'true'
with:
path: vendor
key: cc-dev-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
if: |
(github.event_name == 'push' || steps.filter.outputs.psalm == 'true') &&
steps.composer-cache.outputs.cache-hit != 'true'
with:
php-version: '7.4'
extensions: intl
- name: Composer
if: |
(github.event_name == 'push' || steps.filter.outputs.psalm == 'true') &&
steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-progress
- name: Psalm
if: github.event_name == 'push' || steps.filter.outputs.psalm == 'true'
run: |
php7.4 ./vendor/bin/psalm --output-format=github
phpunit:
name: Unit tests
runs-on: ubuntu-20.04
steps:
- uses: dorny/paths-filter@v2.2.0
id: filter
if: github.event_name == 'pull_request'
with:
filters: |
php:
- '**/*.php'
- '**/*.phtml'
- 'phpunit.xml'
- '.github/workflows/php.yml'
- name: Checkout repository
if: github.event_name == 'push' || steps.filter.outputs.php == 'true'
uses: actions/checkout@v2
- name: Composer cache
uses: actions/cache@v1
id: composer-cache
if: github.event_name == 'push' || steps.filter.outputs.php == 'true'
with:
path: vendor
key: cc-dev-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
if: |
(github.event_name == 'push' || steps.filter.outputs.php == 'true') &&
steps.composer-cache.outputs.cache-hit != 'true'
with:
php-version: '7.4'
extensions: intl
- name: Composer
if: |
(github.event_name == 'push' || steps.filter.outputs.php == 'true') &&
steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-progress
- name: Unit tests
if: github.event_name == 'push' || steps.filter.outputs.php == 'true'
run: |
php7.4 ./vendor/bin/phpunit --printer mheap\\GithubActionsReporter\\Printer