-
-
Notifications
You must be signed in to change notification settings - Fork 28
119 lines (107 loc) · 3.16 KB
/
phpunit.yml
File metadata and controls
119 lines (107 loc) · 3.16 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
name: PHPUnit
on:
push:
branches:
- master
tags:
- "*.*.*"
pull_request:
branches:
- master
jobs:
Build:
runs-on: 'ubuntu-latest'
container:
image: 'byjg/php:${{ matrix.php-version }}-cli'
options: --user root --privileged
strategy:
matrix:
php-version:
- "8.5"
- "8.4"
- "8.3"
services:
mysql:
image: 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:2022-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Pa55word
MSSQL_PID: Developer
ports:
- "1433:1433"
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -U sa -P Pa55word -Q 'SELECT 1' -C -No"
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
MYSQL_TEST_HOST: mysql
PSQL_TEST_HOST: postgres
MSSQL_TEST_HOST: sqlserver
steps:
- uses: actions/checkout@v5
- name: Configure git safe directory
run: git config --global --add safe.directory /__w/php-migration/php-migration
- run: composer install
- run: composer test
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
- run: ./vendor/bin/phpunit tests/MysqlDatabase*
- run: ./vendor/bin/phpunit tests/PostgresDatabase*
Psalm:
name: Psalm Static Analyzer
runs-on: ubuntu-latest
permissions:
# for github/codeql-action/upload-sarif to upload SARIF results
security-events: write
container:
image: byjg/php:8.4-cli
options: --user root --privileged
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Configure git safe directory
run: git config --global --add safe.directory /__w/php-migration/php-migration
- name: Composer
run: composer install
- name: Psalm
# Note: Ignoring error code 2, which just signals that some
# flaws were found, not that Psalm itself failed to run.
run: ./vendor/bin/psalm
--show-info=true
--report=psalm-results.sarif || [ $? = 2 ]
- name: Upload Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v4
if: github.ref == 'refs/heads/master'
with:
sarif_file: psalm-results.sarif
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:
DOC_TOKEN: ${{ secrets.DOC_TOKEN }}