-
Notifications
You must be signed in to change notification settings - Fork 20
69 lines (57 loc) · 1.9 KB
/
tests_composer2.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
name: PHP Unit Tests
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * 0'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
db-type: [sqlite, mysql, pgsql]
composer-type: [lowest, stable, dev]
name: PHP ${{ matrix.php-version }} & ${{ matrix.db-type }} & ${{ matrix.composer-type }}
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_DB: test_fixture_factories
POSTGRES_PASSWORD: root
POSTGRES_USER: root
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, apcu, pdo_${{ matrix.db-type }}
ini-values: apc.enable_cli = 1
coverage: pcov
- name: Update composer
run: composer self-update --snapshot
- name: Validate composer.json
run: composer validate
- name: Install dependencies
run: |
if [[ ${{ matrix.composer-type }} == 'lowest' ]]; then
composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest
elif [[ ${{ matrix.composer-type }} == 'stable' ]]; then
composer update --prefer-dist --no-progress --no-suggest --prefer-stable
else
composer update --prefer-dist --no-progress --no-suggest
fi
- name: Run tests
run: |
if [ ${{ matrix.db-type }} == 'mysql' ]; then
sudo service mysql start && mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE IF NOT EXISTS test_fixture_factories;';
fi
composer ${{ matrix.db-type }}