-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (53 loc) · 1.79 KB
/
php.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
name: PHP Composer
on: [push, pull_request]
jobs:
build:
name: Run tests on ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
services:
mysql:
image: mysql:8.4
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: Phaster
ports:
# map port 3306 on service container to the host
- 3306:3306
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
postgres:
image: postgres
env:
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: psalm
extensions: sqlsrv-5.10.1
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Composer dependencies
run: composer install --no-progress
- name: Run Psalm
run: psalm --output-format=github
if: ${{ matrix.php == '8.3' }}
- name: Run PHPUnit
run: composer test-without-mssql
env:
POSTGRES_HOST: localhost
- name: Check Formatting
run: vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no
if: ${{ matrix.php == '8.3' }}