-
-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (96 loc) · 4.74 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
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
100
101
102
103
104
105
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.operating-system }}
env:
SYMFONY_ENV: behat
DB_HOST: localhost
DB_TYPE: mysql
DB_ROOT_PASSWORD: root
DB_EZ_USER: ezp
DB_EZ_PASSWORD: ezp
DB_EZ_DATABASE: behattestdb
strategy:
fail-fast: false
matrix:
# @see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners for available os versions
include:
- config_file: .euts.cp.env
operating-system: 'ubuntu-20.04'
code-coverage: ~
- config_file: .euts.1.7.env
operating-system: 'ubuntu-20.04'
code-coverage: ~
- config_file: .euts.1.13.env
operating-system: 'ubuntu-20.04'
code-coverage: ~
- config_file: .euts.2.3.env
operating-system: 'ubuntu-22.04'
code-coverage: ~
- config_file: .euts.2.4.env
operating-system: 'ubuntu-22.04'
code-coverage: ~
- config_file: .euts.2.5.env
operating-system: 'ubuntu-22.04'
code-coverage: codecov
steps:
- name: checkout code
uses: actions/checkout@v3
# Although this action is useful, we prefer to use the same script to set up php that we use for the
# docker image used for local testing. This allows us to make sure that the script is always in good shape
#-
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php }}
# extensions: curl, dom, mbstring, xsl
# ini-values: 'cgi.fix_pathinfo=1, always_populate_raw_post_data=-1'
# #tools: phpunit/phpunit:a_version_compatible_with_php_5.3-5.5
# # NB: this disables xdebug completely
# coverage: none
- name: get the teststack
run: |
# @todo we should check out a specific tag/branch for stability, or at least the latest tag...
git clone --depth 1 https://github.com/tanoconsulting/euts.git teststack
# just in case...
chmod 755 ./teststack/bin/*.sh ./teststack/bin/setup/*.sh
# @todo avoid downloading composer deps on every workflow. Is this useful/working for us?
#-
# uses: actions/cache@v2
# with:
# path: /tmp/composer-cache
# key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
# @todo stop any unused service and process to save ram/cpu: php-fpm (esp. if a != php version), docker,
# containerd, snapd, ModemManager?, pakagekit?, xsp4.exe
# This sets up php and starts mysql
- name: set up the test env
run: |
set -a && . Tests/environment/${{ matrix.config_file }} && set +a
./teststack/bin/setup.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: run tests and generate code coverage
if: ${{ matrix.php == '7.4' }}
run: |
set -a && . Tests/environment/${{ matrix.config_file }} && set +a
if [ -z "${{ matrix.code-coverage }}" ]; then
./teststack/bin/runtests.sh
else
./teststack/bin/runtests.sh -c coverage.clover
if [ -f coverage.clover ]; then
if [ "${{ matrix.code-coverage }}" = scrutinizer ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
if [ "${{ matrix.code-coverage }}" = codecov ]; then curl -Os https://uploader.codecov.io/latest/linux/codecov && chmod +x codecov && ./codecov -t ${CODECOV_TOKEN} -f coverage.clover; fi
fi
fi
- name: troubleshoot
if: ${{ failure() }}
run: |
#env
#php -i
#systemctl list-units --all --type=service --no-pager | grep running
#ps auxwww
#dpkg --list | grep php
#pwd
#sudo env
#ls -ltr /var/log
sudo cat /var/log/php*.log