-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (140 loc) · 4.24 KB
/
Copy pathtests.yml
File metadata and controls
167 lines (140 loc) · 4.24 KB
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: Tests
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ["8.2", "8.3", "8.4"]
laravel: ["12.*", "13.*"]
exclude:
- php: "8.2"
laravel: "13.*"
name: PHP ${{ matrix.php }} — Laravel ${{ matrix.laravel }}
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 5
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: redis
coverage: none
- name: Pin Laravel version
run: composer require "laravel/framework:${{ matrix.laravel }}" --no-update --no-interaction
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress
- name: Run tests
run: vendor/bin/phpunit
analyse:
runs-on: ubuntu-latest
name: Static analysis
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
coverage: none
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress
- name: Run Pint
run: composer lint
- name: Run Larastan
run: vendor/bin/phpstan analyse --memory-limit=512M --error-format=github
database:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: MySQL
driver: mysql
image: mysql:8.4
port: 3306
container_port: 3306
username: root
password: normcache
options: >-
--health-cmd "mysqladmin ping --password=normcache"
--health-interval 5s
--health-timeout 3s
--health-retries 10
- label: PostgreSQL
driver: pgsql
image: postgres:17
port: 5432
container_port: 5432
username: postgres
password: normcache
options: >-
--health-cmd "pg_isready -U postgres -d normcache"
--health-interval 5s
--health-timeout 3s
--health-retries 10
- label: MariaDB
driver: mariadb
image: mariadb:11.4
port: 3307
container_port: 3306
username: root
password: normcache
options: >-
--health-cmd "healthcheck.sh --connect --innodb_initialized"
--health-interval 5s
--health-timeout 3s
--health-retries 10
name: Database / ${{ matrix.label }}
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 5
database:
image: ${{ matrix.image }}
env:
MYSQL_DATABASE: normcache
MYSQL_ROOT_PASSWORD: normcache
POSTGRES_DB: normcache
POSTGRES_PASSWORD: normcache
MARIADB_DATABASE: normcache
MARIADB_ROOT_PASSWORD: normcache
ports:
- ${{ matrix.port }}:${{ matrix.container_port }}
options: ${{ matrix.options }}
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: redis, pdo_mysql, pdo_pgsql
coverage: none
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress
- name: Run database contract and cascade tests
env:
TEST_DB_DRIVER: ${{ matrix.driver }}
TEST_DB_HOST: 127.0.0.1
TEST_DB_PORT: ${{ matrix.port }}
TEST_DB_DATABASE: normcache
TEST_DB_USERNAME: ${{ matrix.username }}
TEST_DB_PASSWORD: ${{ matrix.password }}
run: >-
vendor/bin/phpunit
tests/Integration/Contract
tests/Integration/Cache/DeleteInvalidationTest.php