1
1
name : Default
2
2
3
- on :
4
- push :
5
- branches : [ master ]
6
- pull_request :
7
- branches : [ master ]
3
+ on : [push, pull_request]
8
4
9
5
jobs :
10
6
test :
@@ -23,10 +19,26 @@ jobs:
23
19
strategy :
24
20
fail-fast : true
25
21
matrix :
26
- php : [ 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 ]
27
- stability : [ prefer-lowest ]
22
+ include :
23
+ # ThinkPHP 6.*
24
+ - php : 7.1
25
+ thinkphp : 6.*
26
+ - php : 7.2
27
+ thinkphp : 6.*
28
+ - php : 7.4
29
+ thinkphp : 6.*
30
+ - php : 8.0
31
+ thinkphp : 6.*
32
+ - php : 8.1
33
+ thinkphp : 6.*
28
34
29
- name : PHP ${{ matrix.php }} - ${{ matrix.stability }}
35
+ # ThinkPHP 8.*
36
+ - php : 8.0
37
+ thinkphp : 8.*
38
+ - php : 8.1
39
+ thinkphp : 8.*
40
+
41
+ name : ThinkPHP${{ matrix.thinkphp }}-PHP${{ matrix.php }}
30
42
31
43
steps :
32
44
- name : Checkout code
39
51
tools : composer:v2
40
52
coverage : xdebug
41
53
54
+ - name : Pre composer
55
+ if : matrix.thinkphp == '8.*'
56
+ run : composer remove php-coveralls/php-coveralls --dev
57
+
42
58
- name : Validate composer.json and composer.lock
43
59
run : composer validate
44
60
@@ -47,17 +63,40 @@ jobs:
47
63
uses : actions/cache@v3
48
64
with :
49
65
path : vendor
50
- key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
66
+ key : ${{ runner.os }}-${{ matrix.php }}-${{ matrix.thinkphp }}-${{ hashFiles('**/composer.lock') }}
51
67
restore-keys : |
52
- ${{ runner.os }}-${{ matrix.php }}-
68
+ ${{ runner.os }}-${{ matrix.php }}-${{ matrix.thinkphp }}
53
69
54
70
- name : Install dependencies
55
71
if : steps.composer-cache.outputs.cache-hit != 'true'
56
- run : composer install --prefer-dist --no-progress --no-suggest
72
+ run : |
73
+ composer require topthink/framework:${{ matrix.thinkphp }} --no-update --no-interaction
74
+ composer require topthink/think:${{ matrix.thinkphp }} --no-update --no-interaction --dev
75
+ composer install --prefer-dist --no-progress --no-suggest
57
76
58
77
- name : Run test suite
59
78
run : ./vendor/bin/phpunit
60
79
80
+ - name : Run Coveralls
81
+ if : matrix.thinkphp != '8.*'
82
+ env :
83
+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84
+ COVERALLS_PARALLEL : true
85
+ COVERALLS_FLAG_NAME : ${{ runner.os }} - ${{ matrix.php }}
86
+ run : |
87
+ composer global require php-coveralls/php-coveralls:^2.4
88
+ php-coveralls --coverage_clover=build/logs/clover.xml -v
89
+
90
+ upload-coverage :
91
+ runs-on : ubuntu-latest
92
+ needs : [ test ]
93
+ steps :
94
+ - name : Coveralls Finished
95
+ uses : coverallsapp/github-action@master
96
+ with :
97
+ github-token : ${{ secrets.GITHUB_TOKEN }}
98
+ parallel-finished : true
99
+
61
100
semantic-release :
62
101
runs-on : ubuntu-latest
63
102
needs : [ test ]
0 commit comments