-
Notifications
You must be signed in to change notification settings - Fork 23
101 lines (85 loc) · 3.3 KB
/
run-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
name: Unit Tests
on:
push:
branches:
- master
pull_request:
branches:
- "*"
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
php-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
matrix:
php: ['8.3', '8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4']
dependency-version: ['prefer-stable']
experimental: [false]
include:
- php: '7.2'
dependency-version: 'prefer-lowest'
experimental: false
- php: '7.3'
dependency-version: 'prefer-lowest'
experimental: false
- php: '7.4'
dependency-version: 'prefer-lowest'
experimental: false
- php: '8.0'
dependency-version: 'prefer-lowest'
experimental: false
- php: '8.1'
dependency-version: 'prefer-lowest'
experimental: false
- php: '8.2'
dependency-version: 'prefer-lowest'
experimental: false
- php: '8.3'
dependency-version: 'prefer-lowest'
experimental: false
- php: '8.4'
dependency-version: 'prefer-stable'
experimental: true
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL, display_errors=On
coverage: none
tools: composer
# Remove the coding standards package as it has a higher minimum PHP
# requirement and would prevent running the tests on older PHP versions.
- name: 'Composer: remove CS dependency'
run: composer remove --dev --no-update dms/coding-standard --no-interaction
- name: 'Composer: update PHPUnit for testing lowest (PHP 7.2)'
if: ${{ matrix.dependency-version == 'prefer-lowest' && matrix.php == '7.2' }}
run: composer require --no-update phpunit/phpunit:"^8.0" --no-interaction
- name: 'Composer: update PHPUnit for testing lowest (PHP 7.3+)'
if: ${{ matrix.dependency-version == 'prefer-lowest' && matrix.php != '7.2' }}
run: composer require --no-update phpunit/phpunit:"^9.0" --no-interaction
- name: Install dependencies - normal
if: ${{ matrix.php < 8.4 }}
run: |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction
- name: Install dependencies - ignore platform reqs
if: ${{ matrix.php >= 8.4 }}
run: |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --ignore-platform-req=php+ --no-interaction
- name: Migrate PHPUnit configuration if possible
run: vendor/bin/phpunit --migrate-configuration || echo '--migrate-configuration not available'
- name: Execute Unit Tests
run: vendor/bin/phpunit