-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (81 loc) · 2.5 KB
/
Copy pathci.yml
File metadata and controls
85 lines (81 loc) · 2.5 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
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
83
84
85
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: test
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:11
env:
MARIADB_ROOT_PASSWORD: password
MARIADB_DATABASE: framework-tests
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s --health-timeout=5s --health-retries=15
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=10
memcached:
image: memcached:1.6
ports:
- 11211:11211
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USERNAME: root
DB_PASSWORD: password
DB_SCHEMA: framework-tests
REDIS_HOST: 127.0.0.1
MEMCACHED_HOST: 127.0.0.1
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: intl, sodium, gd, mysqli, curl, fileinfo, json, dom, simplexml, mbstring, zip, redis, memcached, apcu
coverage: xdebug
ini-values: apc.enable_cli=1, mysqli.allow_local_infile=1, xdebug.mode="develop,coverage"
- name: Validate composer.json
run: composer validate --no-check-publish
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Run tests
run: |
if [ -f vendor/bin/phpunit ] && { [ -f phpunit.xml.dist ] || [ -f phpunit.xml ]; }; then
vendor/bin/phpunit
else
echo "No PHPUnit config or binary found; nothing to test."
fi
lint:
name: lint
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: intl, sodium, gd, mysqli, curl, fileinfo, json, dom, simplexml, mbstring, zip
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Coding standard (dry-run)
run: |
if [ -f vendor/bin/php-cs-fixer ]; then
vendor/bin/php-cs-fixer fix --dry-run --diff
else
echo "php-cs-fixer not installed; skipping."
fi