-
Notifications
You must be signed in to change notification settings - Fork 8
103 lines (86 loc) · 3.92 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
---
name: Tests
on:
push:
branches: [ main, develop, wip ]
paths-ignore:
- .idea/**
- docs/**
pull_request:
branches: [ develop ]
paths-ignore:
- .idea/**
- docs/**
schedule:
# Every Monday at 00:00:00 UTC.
# @see https://crontab.cronhub.io/
- cron: "0 0 * * 1"
jobs:
quality_check:
name: "Quality Check"
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.1"
- name: "Checkout code"
uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v2 # https://github.com/marketplace/actions/install-composer-dependencies
- name: "Run all quality checks"
run: "composer static"
tests:
name: "${{ matrix.os }} / ${{ matrix.dependencies }} / ${{ matrix.php }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
php: [ "8.1" ]
dependencies: [ lowest, highest ]
steps:
- name: "Debugging info"
run: "rsync --version | head -1"
if: ${{ runner.os != 'Windows' }}
- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "${{ matrix.php }}"
ini-values: assert.active=1, assert.exception=1, zend.assertions=1
- name: "PHP info"
run: "php -i"
- name: "Checkout code"
uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v2 # https://github.com/marketplace/actions/install-composer-dependencies
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Run core tests with coverage"
run: "composer test"
if: ${{ matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' }}
# 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 --exclude-group=windows_only"
if: ${{ runner.os != 'Windows' && !( matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' ) }}
- name: "Run Windows tests"
run: "./vendor/bin/phpunit --no-coverage --exclude-group=no_windows"
if: ${{ runner.os == 'Windows' }}
performance:
name: "Performance"
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.1"
- name: "Checkout code"
uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout
- name: "Install dependencies"
uses: ramsey/composer-install@v2 # https://github.com/marketplace/actions/install-composer-dependencies
with:
# Disable Composer caching due to random failures it causes.
# @see https://github.com/ramsey/composer-install/issues/79
composer-options: "--no-cache"
- name: "Run performance tests"
run: "composer phpbench -- --progress=plain --iterations=5 --ansi"