-
Notifications
You must be signed in to change notification settings - Fork 27
181 lines (170 loc) · 5.42 KB
/
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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Tests
on:
push:
branches:
- "**"
pull_request:
types: [ ready_for_review, synchronize, opened ]
jobs:
matrix:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
include:
- laravel: 11
php: "8.3"
- laravel: 10
php: "8.3"
- laravel: 10
php: "8.2"
- laravel: 9
php: "8.2"
- laravel: 9
php: "8.1"
- laravel: 9
php: "8.0"
- laravel: 8
php: "8.1"
- laravel: 8
php: "8.0"
- laravel: 8
php: "7.4"
- laravel: 8
php: "7.3"
name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }}
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Composer
run: |
rm composer.lock
composer require laravel/framework:^${{ matrix.laravel }}
- name: Test
env:
CREATE_SNAPSHOTS: false
run: composer test -- --exclude-group redis,mongo
sqlsrv:
runs-on: ubuntu-22.04
name: Microsoft SQL Server
steps:
- uses: actions/checkout@v3
- name: MSSQL Server
run: docker run --detach -p 1433:1433 -e SA_PASSWORD=Your_password123 -e ACCEPT_EULA=Y mcr.microsoft.com/mssql/server
- uses: shivammathur/setup-php@v2
with:
extensions: pdo_sqlsrv odbc pdo_odbc
- name: Composer
run: composer update
- name: Wait for containers
run: until /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Your_password123 -Q "SELECT 1" || false; do sleep 1; done
- name: Test
env:
CREATE_SNAPSHOTS: false
DATABASE_URL: sqlsrv://sa:Your_password123@localhost:1433/msdb
run: composer test -- --group sql,eloquent
postgres:
runs-on: ubuntu-22.04
name: PostgreSQL
steps:
- uses: actions/checkout@v3
- name: PostgreSQL
run: docker run --detach -p 5432:5432 -e POSTGRES_PASSWORD=my-secret-pw postgres:latest postgres -c shared_buffers=256MB -c max_connections=2000
- uses: shivammathur/setup-php@v2
with:
extensions: pdo_pgsql
- name: Composer
run: composer update
- name: Wait for containers
run: until pg_isready -q -d postgres -U postgres -h localhost; do sleep 1; done
- name: Test
env:
CREATE_SNAPSHOTS: false
DATABASE_URL: pgsql://postgres:my-secret-pw@localhost:5432/postgres?charset=utf8
run:
composer test -- --group sql,eloquent
mysql:
runs-on: ubuntu-22.04
name: MySQL
steps:
- uses: actions/checkout@v3
- name: MySQL
run: docker run --detach -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_DATABASE=testing mysql:latest mysqld --max-connections=8000
- uses: shivammathur/setup-php@v2
with:
extensions: pdo_mysql
- name: Composer
run: composer update
- name: Wait for containers
run: until mysqladmin ping -h 127.0.0.1 --password=my-secret-pw; do sleep 1; done
- name: Test
env:
CREATE_SNAPSHOTS: false
DATABASE_URL: mysql://root:my-secret-pw@127.0.0.1:3306/testing
run: composer test -- --group sql,eloquent
mongo:
runs-on: ubuntu-22.04
name: MongoDB
steps:
- uses: actions/checkout@v3
- name: Mongo
run: docker run --detach -p 27017:27017 mongo
- uses: shivammathur/setup-php@v2
with:
extensions: mongodb
- name: Composer
run: composer update
- name: Wait for containers
run: until curl --silent localhost:27017 2>&1 > /dev/null || false; do sleep 1; done
- name: Test
env:
CREATE_SNAPSHOTS: false
run: composer test -- --group mongo
redis:
runs-on: ubuntu-22.04
name: Redis
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
extensions: redis
- name: Composer
run: composer update
- name: Test
env:
CREATE_SNAPSHOTS: false
run: composer test -- --group redis
analysis:
runs-on: ubuntu-22.04
name: Analysis
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get git commited-at
run: echo "GIT_COMMITTED_AT=$(git log -1 --pretty=format:%ct)" >> $GITHUB_ENV
- uses: shivammathur/setup-php@v2
with:
extensions: pdo_pgsql, mongodb
- name: Containers
run: |
docker run --detach -p 5432:5432 -e POSTGRES_PASSWORD=my-secret-pw postgres:latest postgres -c shared_buffers=256MB -c max_connections=2000
docker run --detach -p 27017:27017 mongo
- name: Composer
run: composer update
- name: Wait for containers
run: |
until pg_isready -q -d postgres -U postgres -h localhost; do sleep 1; done
until curl --silent localhost:27017 2>&1 > /dev/null || false; do sleep 1; done
- name: Analyze
env:
COMPOSER_PROCESS_TIMEOUT: 10000
run: composer analyse
- name: Report coverage
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: 1be98f680ca97065e8a18ad2df18e67210033bb0708b5b70e4d128b035b0cb45
COMPOSER_PROCESS_TIMEOUT: 10000
with:
coverageCommand: composer coverage