-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.86 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
63
64
65
66
67
68
69
70
71
72
name: Test&lint PHP codebase
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test-and-lint-php:
name: Test&lint PHP codebase
runs-on: ubuntu-20.04
services:
pgsql:
image: postgres:15
env:
POSTGRES_DB: slim
POSTGRES_USER: slim
POSTGRES_PASSWORD: password
PGPASSWORD: password
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-dependencies
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl
coverage: none
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
- name: Run PHP linter
run: composer cs:check
- name: Run PHPSTAN
run: composer phpstan
- name: Execute tests
run: |
php vendor/bin/doctrine migrations:migrate
vendor/bin/phpunit --no-output --testsuite unit --fail-on-incomplete --log-junit junit.xml --coverage-clover clover.xml
env:
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: slim
DB_USER: slim
DB_PASSWORD: password
- name: Execute Architecture tests
run: |
composer test:architecture
- name: Send test coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: clover.xml
fail_ci_if_error: true
verbose: true