-
Notifications
You must be signed in to change notification settings - Fork 4
118 lines (101 loc) · 3.37 KB
/
ci.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
name: "Continuous Integration"
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '.editorconfig'
- '.gitattributes'
- '.github/workflows/noverify.yml'
- '.github/workflows/sonar.yml'
- 'LICENSE'
- 'scripts/**'
- 'sonar-project.properties'
pull_request:
paths-ignore:
- '**.md'
- '.editorconfig'
- '.gitattributes'
- '.github/workflows/noverify.yml'
- '.github/workflows/sonar.yml'
- 'LICENSE'
- 'scripts/**'
- 'sonar-project.properties'
# Allow manually triggering the workflow
workflow_dispatch:
inputs:
random-seed:
description: 'PHPUnit''s random seed'
required: false
default: ''
jobs:
unittest:
name: "Run the unit-tests"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.1"
- "8.2"
- "8.3"
phpunit-args: ['']
include:
- php-version: "8.1"
phpunit-args: "--order-by random"
- php-version: "8.2"
phpunit-args: "--process-isolation"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
ini-values: "error_reporting=-1, display_errors=On, display_startup_errors=On, zend.assertions=1"
tools: "composer:v2"
php-version: "${{ matrix.php-version }}"
- name: Configure Composer for PHP 8.2
run: composer config platform.php 8.1.99
if: matrix.php-version == '8.2'
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --prefer-dist"
- name: "Run the unit-tests"
if: ${{ !contains(matrix.phpunit-args, '--order-by random') || !github.event.inputs.random-seed }}
run: "composer ut -- ${{ matrix.phpunit-args }}"
- name: "Run the unit-tests with random seed"
if: ${{ contains(matrix.phpunit-args, '--order-by random') && github.event.inputs.random-seed }}
run: "composer ut -- ${{ matrix.phpunit-args }} --random-order-seed ${{ github.event.inputs.random-seed }}"
fulltest:
name: "Run all tests (8.1)"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
ini-values: "error_reporting=-1, display_errors=On, display_startup_errors=On, zend.assertions=1"
tools: composer:v2, composer-normalize
php-version: "8.1"
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --prefer-dist"
- name: "Run all tests"
run: "composer test"
- name: "Normalize composer.json"
run: "composer-normalize --dry-run --no-check-lock --no-update-lock"