-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 1.88 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: PHP CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
php-version: [7.4,8.1]
runs-on: ubuntu-latest
# see https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Install gdal, zip and unzip
run: sudo apt-get install -y gdal-bin zip unzip
- name: "Setup PHP ${{ matrix.php-version }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug2
#tools: php-cs-fixer, phpunit
- name: Validate composer.json
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run tests
run: make test
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/validator_api?serverVersion=14&charset=utf8
- name: Upload coverage results to coveralls.io
if: github.ref == 'refs/heads/master' && matrix.php-version == '8.1'
run: |
vendor/bin/php-coveralls --coverage_clover=var/data/output/coverage.xml --json_path=var/data/output/coveralls.json -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}