1
+ name : Default
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ test :
7
+ runs-on : ubuntu-latest
8
+
9
+ services :
10
+ mysql :
11
+ image : mysql:5.7
12
+ env :
13
+ MYSQL_ALLOW_EMPTY_PASSWORD : yes
14
+ MYSQL_DATABASE : tauthz
15
+ ports :
16
+ - 3306:3306
17
+ options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
18
+
19
+ strategy :
20
+ fail-fast : true
21
+ matrix :
22
+ php : [ 8.0, 8.1, 8.2, 8.3 ]
23
+
24
+ name : PHP${{ matrix.php }}
25
+
26
+ steps :
27
+ - name : Checkout code
28
+ uses : actions/checkout@v3
29
+
30
+ - name : Setup PHP
31
+ uses : shivammathur/setup-php@v2
32
+ with :
33
+ php-version : ${{ matrix.php }}
34
+ tools : composer:v2
35
+ coverage : xdebug
36
+
37
+ - name : Validate composer.json and composer.lock
38
+ run : composer validate
39
+
40
+ - name : Cache Composer packages
41
+ id : composer-cache
42
+ uses : actions/cache@v3
43
+ with :
44
+ path : vendor
45
+ key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
46
+ restore-keys : |
47
+ ${{ runner.os }}-${{ matrix.php }}
48
+
49
+ - name : Install dependencies
50
+ if : steps.composer-cache.outputs.cache-hit != 'true'
51
+ run : composer install --prefer-dist --no-progress --no-suggest
52
+
53
+ - name : Run test suite
54
+ run : ./vendor/bin/phpunit
55
+
56
+ - name : Run Coveralls
57
+ env :
58
+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
+ COVERALLS_PARALLEL : true
60
+ COVERALLS_FLAG_NAME : ${{ runner.os }} - ${{ matrix.php }}
61
+ run : |
62
+ composer global require php-coveralls/php-coveralls:^2.4
63
+ php-coveralls --coverage_clover=build/logs/clover.xml -v
64
+
65
+ upload-coverage :
66
+ runs-on : ubuntu-latest
67
+ needs : [ test ]
68
+ steps :
69
+ - name : Coveralls Finished
70
+ uses : coverallsapp/github-action@master
71
+ with :
72
+ github-token : ${{ secrets.GITHUB_TOKEN }}
73
+ parallel-finished : true
74
+
75
+ semantic-release :
76
+ runs-on : ubuntu-latest
77
+ needs : [ test ]
78
+ steps :
79
+ - uses : actions/checkout@v3
80
+ - uses : actions/setup-node@v3
81
+ with :
82
+ node-version : ' lts/*'
83
+
84
+ - name : Run semantic-release
85
+ env :
86
+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
87
+ run : npx semantic-release
0 commit comments