-
-
Notifications
You must be signed in to change notification settings - Fork 283
154 lines (134 loc) · 4.21 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
name: "Run tests"
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
test:
runs-on: ubuntu-latest
services:
mysql57:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: migration
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
mysql8:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: migration
ports:
- 33062:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
postgres:
image: postgis/postgis:13-3.3
env:
POSTGRES_DB: migration
POSTGRES_USER: root
POSTGRES_PASSWORD: "!QAZ2wsx"
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
sqlsrv:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: "!QAZ2wsx"
ACCEPT_EULA: "Y"
ports:
- 1433:1433
options: >-
--health-cmd "echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P '!QAZ2wsx'"
mariadb:
image: mariadb:10
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: "migration"
ports:
- 3307:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
strategy:
matrix:
php: [ 8.1, 8.2 ]
laravel: [ 9.*, 10.* ]
dbal: [ 3.* ]
sqlsrv_extension: [ pdo_sqlsrv ]
include:
- php: 7.1
laravel: 5.7.*
dbal: 2.*
- php: 7.2
laravel: 5.8.*
dbal: 2.*
- php: 7.3
laravel: 6.*
dbal: 2.*
- php: 7.4
laravel: 7.*
dbal: 2.*
- php: 8.0
laravel: 8.*
dbal: 2.*
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Alter MySQL 8 root plugin
run: |
mysql --version
mysql --host 127.0.0.1 --port ${{ job.services.mysql8.ports['3306'] }} -u root -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY ''"
- name: SQL Server Create Database
run: |
# Create DB
sqlcmd -S 127.0.0.1 -U sa -P '!QAZ2wsx' -Q 'CREATE DATABASE migration' -b
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, memcached, ${{matrix.sqlsrv_extension}}
tools: composer:v2
coverage: pcov
- name: Install dependencies
run: |
composer config --no-plugins allow-plugins.kylekatarnls/update-helper true
composer require "laravel/framework:${{ matrix.laravel }}" "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction --no-progress
- name: Setup PCOV
if: ${{ matrix.laravel == '5.7.*' }}
run: |
composer require pcov/clobber
vendor/bin/pcov clobber
- name: Setup .env
run: |
mkdir ./database
composer run action-env-setup
- name: Execute tests with PHPUnit 8 or below
if: ${{ matrix.laravel == '5.7.*' || matrix.laravel == '5.8.*' }}
run: vendor/bin/phpunit -c ./phpunit8.xml --coverage-clover=coverage.xml
- name: Execute tests
if: ${{ matrix.laravel != '5.7.*' && matrix.laravel != '5.8.*' }}
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
files: coverage.xml