-
Notifications
You must be signed in to change notification settings - Fork 105
59 lines (47 loc) · 1.63 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
56
57
58
59
name: CI
on: [push, pull_request]
jobs:
ci:
runs-on: ubuntu-20.04
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php }}
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: phproject
ports:
- 3306/tcp
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 3
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpunit:8.5
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- uses: actions/cache@v3
env:
cache-name: cache-composer
with:
path: ~/.composer
key: ${{ runner.os }}-ci-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-ci-${{ env.cache-name }}-
${{ runner.os }}-ci-
${{ runner.os }}-
- name: Syntax check
run: if find . -name "*.php" ! -path "./vendor/*" -exec php -l {} 2>&1 \; | grep "syntax error, unexpected"; then exit 1; fi
- name: Composer
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- run: vendor/bin/phpcs
- name: Install Phproject
run: php install.php --site-name=Test --site-url=http://localhost/ --timezone=America/Phoenix --admin-username=test --admin-email=test@example.com --admin-password=secret --db-host=127.0.0.1 --db-port=${{ job.services.mysql.ports['3306'] }} --db-user=root