-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.2 KB
/
php-ci.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
name: "PHP CI"
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
php-ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_DB: gib_potato_test
POSTGRES_USER: gib_potato
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 3s
--health-timeout 1s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl
- name: Run composer install
run: composer update --no-progress
- name: Run PHP CodeSniffer
run: vendor/bin/phpcs --colors -p src/ tests/
- name: Run PHPStan
run: vendor/bin/phpstan analyse
- name: Run PHPUnit
run: |
export CODECOVERAGE=1
vendor/bin/phpunit --colors=always --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}