-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (96 loc) · 3.18 KB
/
test.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: phpunit
on:
workflow_dispatch:
inputs:
debug:
type: boolean
default: false
push: ~
jobs:
phpunit:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq
ports:
- 5672:5672
strategy:
matrix:
# the actual arche-core is run inside the docker container
# using the PHP version as provided by the build/docker/Dockerfile
# but it allows to check dependencies as the "composer update" is run locally
php: [8.1, 8.2, 8.3, 8.4]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
java-package: jdk
distribution: oracle
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd,json,mbstring,pcre,xmlreader,yaml
coverage: xdebug
env:
fail-fast: true
- name: composer update
run: |
composer update
- name: environment
run: |
docker build -t arche-dev build/docker
mkdir log
docker run --name arche-dev -v `pwd`:/var/www/html -e USER_UID=`id -u` -e USER_GID=`id -g` -d arche-dev
sleep 10
- uses: mxschmitt/action-tmate@v3
if: inputs.debug
- name: test-mod_php
run: |
docker exec -t -e XDEBUG_MODE=coverage -u www-data arche-dev vendor/bin/phpunit
- name: test-php_fpm
run: |
docker exec arche-dev a2dissite mod_php
docker exec arche-dev a2ensite php_fpm
docker exec -w /root arche-dev supervisorctl restart apache2
docker exec -t -e XDEBUG_MODE=coverage -u www-data arche-dev vendor/bin/phpunit --display-deprecations --display-phpunit-deprecations --display-notices --display-warnings
- name: coveralls
run: |
export COVERALLS_RUN_LOCALLY=1
export COVERALLS_REPO_TOKEN=${{ secrets.coverallsToken }}
rm -fR composer.json composer.lock vendor
composer require php-coveralls/php-coveralls
sudo rm -fR /var/www/html
sudo ln -s "`pwd`" /var/www/html
vendor/bin/php-coveralls -v
- name: debug
if: ${{ always() }}
run: |
echo "---------- config.yaml:"
cat tests/config.yaml
echo "---------- apache.conf:"
docker exec arche-dev cat /etc/apache2/sites-available/000-default.conf
echo "---------- apache error log"
docker exec arche-dev cat /var/log/apache2/error.log
echo "---------- apache access log"
docker exec arche-dev cat /var/log/apache2/access.log
echo "---------- txlog:"
docker exec arche-dev cat /tmp/arche-core/log/txlog
echo "---------- restlog:"
docker exec arche-dev cat /tmp/arche-core/log/restlog
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: composer
run: composer update
- name: phpstan
run: vendor/bin/phpstan analyse -l 8 src tests || true