-
-
Notifications
You must be signed in to change notification settings - Fork 27
92 lines (86 loc) · 2.47 KB
/
phpunit.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
name: PHPUnit
on:
push:
branches:
- master
tags:
- "*.*.*"
pull_request:
branches:
- master
schedule:
- cron: "0 9 * * 1"
jobs:
Build:
runs-on: 'ubuntu-latest'
container: 'byjg/php:${{ matrix.php-version }}-cli'
strategy:
matrix:
php-version:
- "8.3"
- "8.2"
- "8.1"
services:
mysql:
image: bitnami/mysql:8.0.20
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=20s
--health-retries=10
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
# sqlserver:
# image: mcr.microsoft.com/mssql/server
# env:
# ACCEPT_EULA: Y
# SA_PASSWORD: Pa55word
# ports:
# - "1433:1433"
# options: >-
# --health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P Pa55word -Q 'SELECT 1'"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
env:
MYSQL_TEST_HOST: mysql
PSQL_TEST_HOST: postgres
MSSQL_TEST_HOST: sqlserver
steps:
- uses: actions/checkout@v4
# - name: Spin up databases
# run: |
# apk add --no-cache python3 python3-dev py3-pip build-base libffi-dev
# pip3 install --upgrade pip
# pip3 install docker-compose
# apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community docker
# docker-compose up -d postgres mysql
- run: composer install
- run: ./vendor/bin/psalm
- run: ./vendor/bin/phpunit
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
- run: ./vendor/bin/phpunit tests/MysqlDatabase*
- run: ./vendor/bin/phpunit tests/PostgresDatabase*
# - run: ./vendor/bin/phpunit tests/SqlServerSqlsrv*
# - run: ./vendor/bin/phpunit tests/SqlServerDblib*
Documentation:
if: github.ref == 'refs/heads/master'
needs: Build
uses: byjg/byjg.github.io/.github/workflows/add-doc.yaml@master
with:
folder: php
project: ${{ github.event.repository.name }}
secrets: inherit