-
Notifications
You must be signed in to change notification settings - Fork 32
61 lines (55 loc) · 1.82 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
name: "Tests"
on:
push:
branches: [master]
paths-ignore:
- '**.md'
- 'cli/'
- 'electron/'
- 'www/'
pull_request:
branches: [master]
paths-ignore:
- '**.md'
- 'cli/'
- 'electron/'
- 'www/'
jobs:
server-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Install Linux dependencies"
timeout-minutes: 1
run: |
sudo apt-get update && sudo apt-get install -y \
composer
sudo sh -c 'echo "zend.assertions = 1" >> /etc/php/8.1/cli/php.ini'
- name: "Install Composer dependencies"
timeout-minutes: 1
run: |
composer install -o
- name: "Run Composer check"
timeout-minutes: 1
run: |
export XDEBUG_MODE=off
composer check
- name: "Check code coverage min percentage"
timeout-minutes: 4
run: |
echo '<?php preg_match("~Lines:\s+([\d.]+)%~", stream_get_contents(STDIN), $m);exit((int)((float)$m[1] < 100));' > cc.php
export XDEBUG_MODE=coverage
composer unit -- --stderr --no-progress --colors=never \
--coverage-xml=www/coverage/coverage-xml --log-junit=www/coverage/junit.xml \
--coverage-text --only-summary-for-coverage-text 2> cc.txt
cat cc.txt
grep 'Lines: ' cc.txt | php -d error_reporting=E_ALL cc.php
- name: "Check infection mutation framework min percentage"
timeout-minutes: 5
run: |
export XDEBUG_MODE=off
grep '"timeout": 20,' infection.json5
sed -i 's/"timeout": 20,/"timeout": 40,/' infection.json5
composer infection-cache -- --threads=$(($(nproc) + 1)) --only-covering-test-cases --skip-initial-tests