-
Notifications
You must be signed in to change notification settings - Fork 10
128 lines (104 loc) · 3.33 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
119
120
121
122
123
124
125
126
127
128
name: Continuous Integration
on:
workflow_call:
pull_request:
branches:
- "master"
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
validate-master:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Validate Mergable"
run: git merge origin/master --no-commit --ff-only
phpunit-composer-latest:
needs: validate-master
runs-on: ${{ matrix.operating-system }}
strategy:
max-parallel: 3
fail-fast: true
matrix:
operating-system: ["ubuntu-latest"]
php-versions: ["8.0", "8.1", "8.2", "8.3", "8.4"]
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
- name: "Composer State"
run: composer update --no-install --with-all-dependencies
- name: "Composer Name Hash"
id: composer-hash
uses: KEINOS/gh-action-hash-for-cache@main
with:
path: ./composer.lock
- name: "Caching"
id: cache-composer
uses: actions/cache@v4
with:
path: vendor
key: composer-default-${{ steps.composer-hash.outputs.hash }}
restore-keys: composer-default-${{ steps.composer-hash.outputs.hash }}
- name: "Install Dependencies"
if: ${{ steps.cache-composer.outputs.cache-hit != 'true' }}
run: composer install
- name: "Linux: Restore Vendor Executable"
run: chmod -R 0755 vendor
- name: "PHPUnit"
run: ./vendor/bin/phpunit
phpunit-composer-lowest:
needs: validate-master
runs-on: ${{ matrix.operating-system }}
strategy:
max-parallel: 3
fail-fast: true
matrix:
operating-system: ["ubuntu-latest"]
php-versions: ["8.0", "8.1", "8.2", "8.3"]
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
- name: "Composer State"
run: composer update --prefer-lowest --no-install --with-all-dependencies
- name: "Composer Name Hash"
id: composer-hash
uses: KEINOS/gh-action-hash-for-cache@main
with:
path: ./composer.lock
- name: "Caching"
id: cache-composer
uses: actions/cache@v4
with:
path: vendor
key: composer-lowest-${{ steps.composer-hash.outputs.hash }}
restore-keys: composer-lowest-${{ steps.composer-hash.outputs.hash }}
- name: "Install Dependencies"
if: ${{ steps.cache-composer.outputs.cache-hit != 'true' }}
run: composer install
- name: "Linux: Restore Vendor Executable"
if: matrix.operating-system == 'ubuntu-latest'
run: chmod -R 0755 vendor
- name: "PHPUnit"
run: ./vendor/bin/phpunit