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 : casbin
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 : [ 7.1, 7.2, 7.3, 7.4, 8.0 ]
23- stability : [ prefer-lowest, prefer-stable ]
24-
25- name : PHP ${{ matrix.php }} - ${{ matrix.stability }}
26-
27- steps :
28- - name : Checkout code
29- uses : actions/checkout@v2
30-
31- - name : Setup PHP
32- uses : shivammathur/setup-php@v2
33- with :
34- php-version : ${{ matrix.php }}
35- tools : composer:v2
36- coverage : xdebug
37-
38- - name : Validate composer.json and composer.lock
39- run : composer validate
40-
41- - name : Cache Composer packages
42- id : composer-cache
43- uses : actions/cache@v2
44- with :
45- path : vendor
46- key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
47- restore-keys : |
48- ${{ runner.os }}-${{ matrix.php }}-
49-
50- - name : Install dependencies
51- if : steps.composer-cache.outputs.cache-hit != 'true'
52- run : composer install --prefer-dist --no-progress --no-suggest
53-
54- - name : Run test suite
55- run : ./vendor/bin/phpunit
56-
57- semantic-release :
58- runs-on : ubuntu-latest
59- needs : [ test ]
60- steps :
61- - uses : actions/checkout@v2
62- - uses : actions/setup-node@v2
63- with :
64- node-version : ' lts/*'
65-
66- - name : Run semantic-release
67- env :
68- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
1+ name : build
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 : casbin
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 : [ 7.1, 7.2, 7.3, 7.4, 8.0 ]
23+ stability : [ prefer-lowest, prefer-stable ]
24+
25+ name : PHP ${{ matrix.php }} - ${{ matrix.stability }}
26+
27+ steps :
28+ - name : Checkout code
29+ uses : actions/checkout@v2
30+
31+ - name : Setup PHP
32+ uses : shivammathur/setup-php@v2
33+ with :
34+ php-version : ${{ matrix.php }}
35+ tools : composer:v2
36+ coverage : xdebug
37+
38+ - name : Validate composer.json and composer.lock
39+ run : composer validate
40+
41+ - name : Cache Composer packages
42+ id : composer-cache
43+ uses : actions/cache@v2
44+ with :
45+ path : vendor
46+ key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
47+ restore-keys : |
48+ ${{ runner.os }}-${{ matrix.php }}-
49+
50+ - name : Install dependencies
51+ if : steps.composer-cache.outputs.cache-hit != 'true'
52+ run : composer install --prefer-dist --no-progress --no-suggest
53+
54+ - name : Run test suite
55+ run : ./vendor/bin/phpunit
56+
57+ semantic-release :
58+ runs-on : ubuntu-latest
59+ needs : [ test ]
60+ steps :
61+ - uses : actions/checkout@v2
62+ - uses : actions/setup-node@v2
63+ with :
64+ node-version : ' lts/*'
65+
66+ - name : Run semantic-release
67+ env :
68+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
6969 run : npx semantic-release
0 commit comments