-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (55 loc) · 1.67 KB
/
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
name: CI
on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
ports: ["3306:3306"]
env:
MARIADB_USER: test
MARIADB_PASSWORD: password
MARIADB_ROOT_PASSWORD: password
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=10
strategy:
matrix:
php-versions: ['8.2', '8.3', '8.4']
env:
DB_HOST: '127.0.0.1'
DB_USER: root
DB_PASSWORD: password
XDEBUG_MODE: coverage
extensions: bcmath
key: cache-v1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: "Set up PHP ${{ matrix.php-versions }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: bcmath
coverage: xdebug
tools: phpcs, phpunit
- name: Install dependencies
run: composer install
- name: Figure out the PSR-4 autoload situation
run: composer dump-autoload -o --strict-psr
- name: PHPCS
run: ./vendor/bin/phpcs ./src/
- name: PHPUnit
run: ./vendor/bin/phpunit --testdox --coverage-text --coverage-filter=src