-
-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (67 loc) · 2.41 KB
/
tests.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
73
74
75
76
77
78
79
80
81
82
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
NO_DOCKER: true
APP_ENVIRONMENT: test
DB_HOST: localhost
DB_USERNAME: postgres
DB_PASSWORD: postgres
COVERAGE: --coverage-text
MOCK_HOST: "http://127.0.0.1:8001"
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-22.04]
php-versions: ['8.2', '8.3']
services:
postgres:
image: postgres:13-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
name: PHP ${{ matrix.php-versions }} CI on ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
extensions: intl, gettext, pcntl, gd, pdo, pdo_pgsql
ini-values: browscap=${{ github.workspace }}/docker/lite_php_browscap.ini
- name: Setup locales
run: |
sudo apt-get install locales
sudo locale-gen fr_FR.UTF-8 en_GB.UTF-8
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install
- name: Setup the application
run: make setup
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}
- name: Run mock_server (background)
run: php -t ${{ github.workspace }} -S 127.0.0.1:8001 ${{ github.workspace }}/tests/mock_server/index.php &
- name: Run the test suite
run: make test
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}