-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (52 loc) · 2.3 KB
/
Copy pathphpunit.yaml
File metadata and controls
54 lines (52 loc) · 2.3 KB
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
name: PHPUnit
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
symfony-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dbal: ['^3.8', '^4.0']
name: PHPUnit (DBAL ${{ matrix.dbal }})
steps:
- name: Runs Elasticsearch
run: |
docker run -d --name elasticsearch -p 9200:9200 -e discovery.type=single-node \
-e xpack.security.enabled=false -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
docker.elastic.co/elasticsearch/elasticsearch:8.17.0
- name: Wait for Elasticsearch
run: |
for i in $(seq 1 60); do curl -s localhost:9200 >/dev/null && exit 0; sleep 2; done
docker logs elasticsearch; exit 1
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- uses: actions/checkout@v4
- name: Copy .env.test.local
run: php -r "file_exists('.env.test.local') || copy('.env.test', '.env.test.local');"
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-dbal${{ matrix.dbal }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-dbal${{ matrix.dbal }}-
- name: Pin Elasticsearch client to the server major version
run: composer require --no-update --no-interaction "elasticsearch/elasticsearch:^8.0"
- name: Pin Doctrine DBAL to the matrix major version
run: composer require --no-update --no-interaction "doctrine/dbal:${{ matrix.dbal }}"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Create Database
run: |
mkdir -p data
touch data/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DATABASE_URL: sqlite:///%kernel.project_dir%/data/database.sqlite
run: vendor/bin/simple-phpunit