forked from immobiliare/ApnsPHP
-
Notifications
You must be signed in to change notification settings - Fork 10
133 lines (115 loc) · 3.91 KB
/
php-tests.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# SPDX-FileCopyrightText: Copyright 2021 M2mobi B.V., Amsterdam, The Netherlands
# SPDX-FileCopyrightText: Copyright 2022 Move Agency Group B.V., Zwolle, The Netherlands
# SPDX-License-Identifier: CC0-1.0
name: PHP Tests
on:
push:
branches:
- master
- main
- release/*
schedule:
- cron: '30 5 * * 1-5'
pull_request:
workflow_dispatch:
jobs:
phpunit:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
name: "PHP-${{ matrix.php-versions }}: PHPUnit"
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
experimental: [false]
include:
- php-versions: 8.4
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: uopz
tools: phpunit:9.5.x
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update
- name: Setup fake certificates
run: |
touch entrust_root_certification_authority.pem
touch server_certificates_bundle_sandbox.pem
touch server_certificates_bundle_unreadable.pem
chmod 000 server_certificates_bundle_unreadable.pem
- name: Run PHPUnit
run: phpunit -c phpunit.xml
phpcs:
runs-on: ubuntu-latest
continue-on-error: false
name: "PHPCS"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHPCS
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: cs2pr, phpcs
- name: Run PHPCS
run: phpcs -q --report=checkstyle ApnsPHP | cs2pr
phpstan:
runs-on: ubuntu-latest
continue-on-error: false
name: "PHPStan"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHPStan
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: phpstan
extensions: uopz
- name: Install dependencies
run: composer update
- name: Run PHPStan
run: phpstan analyse ApnsPHP -l5
conclusion:
needs: [phpunit, phpcs, phpstan]
continue-on-error: true
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'move-backend' && github.ref_name == 'master' }}
name: "Report status"
steps:
- name: Post build message
uses: slackapi/[email protected]
if: github.event_name != 'schedule'
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "*GitHub Action build result*: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
blocks:
- type: "section"
text:
type: "mrkdwn"
text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
- name: Post failure message
uses: slackapi/[email protected]
if: failure()
with:
webhook: ${{ secrets.SLACK_FAILURE_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "*GitHub Action build result*: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
blocks:
- type: "section"
text:
type: "mrkdwn"
text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"