-
-
Notifications
You must be signed in to change notification settings - Fork 284
127 lines (110 loc) · 3.3 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
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.2, 8.3, 8.4 ]
laravel: [ 11.* ]
sqlsrv_extension: [ pdo_sqlsrv ]
include:
- php: 8.1
laravel: 10.43.*
- php: 8.1
laravel: 10.*
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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 }}" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction --no-progress
- name: Setup environment
run: |
mkdir ./database
composer run action-env-setup
- name: Execute tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload to codecov
uses: codecov/codecov-action@v4
with:
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}