-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1.2 KB
/
t.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
name: "Annotate & Tidy"
on:
push:
branches:
- "feature/*"
- "release/*"
- "develop"
jobs:
tidy:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
with:
command: update --with silverstripe/framework:^5.0
php_version: 8.1
php_extensions: xdebug intl
- name: Generate Code Coverage
run: |
XDEBUG_MODE=coverage \
./vendor/bin/phpunit -c phpunit.xml.dist \
--coverage-clover ./coverage.xml
- name: Annotate with Metrics
run: |
find src -name "*.php" | xargs ./vendor/bin/metrics annotate ./coverage.xml
- name: Tidy Source Code
run: |
find tests -name "*.php" | xargs ./vendor/bin/phptidy.php replace
find src -name "*.php" | xargs ./vendor/bin/phptidy.php replace
- name: Push Back Changes
run: |
git diff --exit-code src tests || ( \
git config user.name github-actions && \
git config user.email github-actions@github.com && \
git add src && git add tests && \
git commit -m "tidy" && \
git push \
)