-
-
Notifications
You must be signed in to change notification settings - Fork 5
119 lines (90 loc) · 4.27 KB
/
test-pull-requests.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: 🧪 Test Suite (Pull Requests)
on:
pull_request:
branches: [ "master" ]
jobs:
test-coverage:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@16011a795d747d5f45038f96371c3b98aec5669d
with:
php-version: "8.0"
coverage: xdebug
extensions: fileinfo
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Set environment to testing
run: echo "ENV=testing" > .env
- name: Output debug information
run: php hyde debug
- name: Execute tests (Unit and Feature tests) via PHPUnit with coverage
run: vendor/bin/pest --coverage --coverage-text=build/coverage/report.txt --colors=always --coverage-clover build/coverage/clover.xml --coverage-cobertura build/coverage/cobertura.xml --coverage-crap4j build/coverage/crap4j.xml --coverage-xml build/coverage/coverage-xml --log-junit build/junit.xml --testdox-text testdox.txt
env:
ENV: testing
- uses: codecov/codecov-action@v2
with:
files: ./build/coverage/clover.xml,./build/coverage/crap4j.xml,./build/coverage/report.txt,./build/junit.xml
- name: Ping statistics server with test results
run: |
curl https://gist.githubusercontent.com/caendesilva/d76fc6d73cb488863a8f6fda18a7c8c4/raw/1d22747e5064b40e4da05e7666d1ab1d2766de7a/ping-openanalytics-testrunner.php -o ping.php
php ping.php "Monorepo PR Test" ${{ secrets.OPENANALYTICS_TOKEN }}
test-matrix:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.0, 8.1]
runs-on: ${{ matrix.os }}
steps:
- uses: shivammathur/setup-php@16011a795d747d5f45038f96371c3b98aec5669d
with:
php-version: ${{ matrix.php }}
extensions: fileinfo
- uses: actions/checkout@v3
- name: Install Composer Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Execute tests (Unit and Feature tests) via PHPUnit
run: vendor/bin/pest --testdox-text testdox.txt
- name: Ping statistics server with test results
run: |
curl https://gist.githubusercontent.com/caendesilva/d76fc6d73cb488863a8f6fda18a7c8c4/raw/1d22747e5064b40e4da05e7666d1ab1d2766de7a/ping-openanalytics-testrunner.php -o ping.php
php ping.php "Monorepo PR Matrix" ${{ secrets.OPENANALYTICS_TOKEN }}
# check-coding-standards:
# runs-on: ubuntu-latest
# steps:
# - uses: shivammathur/setup-php@16011a795d747d5f45038f96371c3b98aec5669d
# with:
# php-version: "8.0"
# - uses: actions/checkout@v3
# - name: Install Composer Dependencies
# run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
# - name: Create cache directory
# run: mkdir build/cache -p
# - name: Check syntax (PHP Parallel Lint)
# run: vendor/bin/parallel-lint --colors app config packages tests --show-deprecated
# - name: Check coding syntax/standards (PHP CodeSniffer)
# run: vendor/bin/phpcs --colors --cache=build/cache/phpcs.cache packages --standard=PSR2 --extensions="php" --ignore="*test.php,*.blade.php,ValidationService.php" || true
# run-static-analysis:
# runs-on: ubuntu-latest
# steps:
# - uses: shivammathur/setup-php@16011a795d747d5f45038f96371c3b98aec5669d
# with:
# php-version: "8.0"
# - uses: actions/checkout@v3
# - name: Install Composer Dependencies
# run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
# - name: Run static analysis (PHPStan)
# run: vendor/bin/phpstan analyse --ansi packages/framework/src packages/realtime-compiler/src || true
# - name: Run static analysis (Psalm/Shepherd)
# run: vendor/bin/psalm --shepherd || true