16
16
17
17
jobs :
18
18
19
- test :
20
-
21
- strategy :
22
- fail-fast : false
23
- matrix :
24
- include :
25
- - operating-system : ' ubuntu-latest'
26
- silverstripe-version : ' 5.0'
27
- php-version : ' 8.1'
28
- - operating-system : ' ubuntu-latest'
29
- silverstripe-version : ' 4.0'
30
- php-version : ' 8.0'
31
- - operating-system : ' ubuntu-latest'
32
- silverstripe-version : ' 4.0'
33
- php-version : ' 7.4'
34
-
35
- name : SS ${{ matrix.silverstripe-version }}, PHP ${{ matrix.php-version }}
36
- runs-on : ${{ matrix.operating-system }}
37
- steps :
38
- - uses : actions/checkout@v3
39
- - uses : php-actions/composer@v6
40
- with :
41
- command : update
42
- --with silverstripe/framework:^${{ matrix.silverstripe-version }}
43
- php_version : ${{ matrix.php-version }}
44
- php_extensions : intl
45
- - run : |
46
- ./vendor/bin/phpunit -c phpunit.xml.dist
47
-
48
- tidy :
49
-
50
- name : " Annotate & Tidy"
51
- needs : [test]
19
+ latest :
20
+ name : " Build & Verify"
52
21
runs-on : ' ubuntu-latest'
53
22
steps :
54
23
- uses : actions/checkout@v3
@@ -65,30 +34,56 @@ jobs:
65
34
--coverage-clover ./coverage.xml
66
35
- name : Annotate with Metrics
67
36
run : |
68
- find src -name "*.php" | xargs ./vendor/bin/metrics annotate ./coverage.xml
37
+ find src -name "*.php" | xargs -n 1 ./vendor/bin/metrics annotate ./coverage.xml
69
38
- name : Refactor with Rector
70
39
run : |
71
40
./vendor/bin/rector process src
72
41
- name : Tidy Source Code
73
42
run : |
74
- find tests -name "*.php" | xargs ./vendor/bin/phptidy.php replace
75
- find src -name "*.php" | xargs ./vendor/bin/phptidy.php replace
43
+ find tests -name "*.php" | xargs -n 1 ./vendor/bin/phptidy.php replace
44
+ find src -name "*.php" | xargs -n 1 ./vendor/bin/phptidy.php replace
76
45
- name : Push Back Changes
77
46
run : |
78
47
git diff --exit-code src || ( \
79
48
git config user.name github-actions && \
80
49
git config user.email github-actions@github.com && \
81
- git add src && \
50
+ git add . && \
82
51
git commit -m "tidy" && \
83
52
git fetch --unshallow origin ${{ github.head_ref || github.ref_name }} && \
84
53
git push origin HEAD:${{ github.head_ref || github.ref_name }} \
85
54
)
86
55
87
- merge :
56
+ matrix :
57
+ strategy :
58
+ fail-fast : false
59
+ matrix :
60
+ include :
61
+ - operating-system : ' ubuntu-latest'
62
+ silverstripe-version : ' 5.0'
63
+ php-version : ' 8.1'
64
+ - operating-system : ' ubuntu-latest'
65
+ silverstripe-version : ' 4.0'
66
+ php-version : ' 8.0'
67
+ - operating-system : ' ubuntu-latest'
68
+ silverstripe-version : ' 4.0'
69
+ php-version : ' 7.4'
70
+ name : " Matrix: SS ${{ matrix.silverstripe-version }}, PHP ${{ matrix.php-version }}"
71
+ runs-on : ${{ matrix.operating-system }}
72
+ steps :
73
+ - uses : actions/checkout@v3
74
+ - uses : php-actions/composer@v6
75
+ with :
76
+ command : update
77
+ --with silverstripe/framework:^${{ matrix.silverstripe-version }}
78
+ php_version : ${{ matrix.php-version }}
79
+ php_extensions : intl
80
+ - run : |
81
+ ./vendor/bin/phpunit -c phpunit.xml.dist
88
82
83
+ merge :
89
84
name : " Merge Changes"
90
85
if : github.event_name == 'push'
91
- needs : [test ]
86
+ needs : [latest,matrix ]
92
87
runs-on : ' ubuntu-latest'
93
88
steps :
94
89
- uses : actions/checkout@v3
0 commit comments