-
Notifications
You must be signed in to change notification settings - Fork 8
167 lines (138 loc) · 6.65 KB
/
main.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
name: Main
on:
push:
branches: [ main, develop, wip ]
# As of September 19, 2023, these paths-ignore patterns don't work due to
# a bug in GitHub Actions See https://github.com/actions/runner/issues/2324
# Ditto below.
paths-ignore:
- '.idea/**'
- '**/*.md'
pull_request:
branches: [ develop ]
paths-ignore:
- '.idea/**'
- '**/*.md'
schedule:
# Every Monday at 00:00:00 UTC.
# @see https://crontab.cronhub.io/
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
static_analysis:
name: "Static Analysis"
runs-on: ubuntu-latest
steps:
- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "8.2"
coverage: none
- name: "Checkout code"
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v3 # https://github.com/marketplace/actions/install-composer-dependencies
- name: "Run all static analysis tools"
run: "composer static"
tests:
name: "Tests: ${{ matrix.os }} / ${{ matrix.php }} / ${{ matrix.dependencies }}${{ matrix.os == 'ubuntu' && matrix.dependencies == 'high' && matrix.php == '8.3' && ' w/ coverage' || '' }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
os: [ ubuntu, macos, windows ]
php: [ "8.1", "8.2", "8.3" ]
dependencies: [ low, high ]
steps:
- name: "Install rsync"
uses: GuillaumeFalourd/[email protected] # https://github.com/marketplace/actions/setup-rsync
- name: "Set up PHP w/ Coverage"
if: ${{ matrix.os == 'ubuntu' && matrix.dependencies == 'high' && matrix.php == '8.3' }}
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "${{ matrix.php }}"
extensions: gd
ini-values: zend.assertions=1
- name: "Set up PHP w/o Coverage"
if: ${{ !( matrix.os == 'ubuntu' && matrix.dependencies == 'high' && matrix.php == '8.3' ) }}
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "${{ matrix.php }}"
coverage: none
extensions: gd
ini-values: zend.assertions=1
- name: "Debugging info"
run: |
rsync --version | head -1
php -i
- name: "Checkout code"
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v3 # https://github.com/marketplace/actions/install-composer-dependencies
with:
dependency-versions: "${{ matrix.dependencies }}est"
- name: "Run core tests with coverage"
run: "composer test"
if: ${{ matrix.os == 'ubuntu' && matrix.dependencies == 'high' && matrix.php == '8.3' }}
# There's no reason to generate coverage data on multiple jobs--the result should be the same.
- name: "Run core tests without coverage"
run: "./vendor/bin/phpunit --no-coverage --testsuite=all --exclude-group=windows_only"
if: ${{ runner.os != 'Windows' && !( matrix.os == 'ubuntu' && matrix.dependencies == 'high' && matrix.php == '8.3' ) }}
- name: "Run Windows tests"
run: "./vendor/bin/phpunit --no-coverage --testsuite=all --exclude-group=no_windows"
if: ${{ runner.os == 'Windows' }}
performance:
name: "Performance: ${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows ]
steps:
- name: "Install rsync"
uses: GuillaumeFalourd/[email protected] # https://github.com/marketplace/actions/setup-rsync
- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "8.2"
coverage: none
- name: "Checkout code"
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v3 # https://github.com/marketplace/actions/install-composer-dependencies
- name: "Run performance tests"
run: "composer phpbench -- --progress=plain --ansi"
compatability:
name: "Compatability"
runs-on: ubuntu-latest
steps:
- name: "Install rsync"
uses: GuillaumeFalourd/[email protected] # https://github.com/marketplace/actions/setup-rsync
- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "8.3"
coverage: none
- name: "Checkout code"
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v3 # https://github.com/marketplace/actions/install-composer-dependencies
- name: "Run compatability tests"
run: "composer compatability"
mutation:
name: "Mutation"
runs-on: ubuntu-latest
steps:
- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "8.2"
extensions: gd
ini-values: zend.assertions=1
- name: "Checkout code"
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v3 # https://github.com/marketplace/actions/install-composer-dependencies
- name: "Run mutation tests"
run: "composer infection"