This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (62 loc) · 2.15 KB
/
main.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: ['7.4', '8.0']
laravel: ['7.*', '8.*']
include:
- laravel: '7.*'
testbench: '5.*'
- laravel: '8.*'
testbench: '6.*'
name: P${{ matrix.php }} - L${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json, mbstring, zip, sqlite, pdo_sqlite
coverage: pcov
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction
# Lower PHP and laravel versions.
- name: PHPUnit
if: matrix.php != '8.0' || matrix.laravel != '8.*'
run: vendor/bin/phpunit
# Last PHP and laravel versions.
- name: Code analysis
if: matrix.php == '8.0' && matrix.laravel == '8.*'
run: |
vendor/bin/phpcs
vendor/bin/phpmd src text phpmd.xml
vendor/bin/phpstan analyse
- name: PHPUnit + Code coverage
if: matrix.php == '8.0' && matrix.laravel == '8.*'
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
- name: Code coverage upload to Coveralls
if: matrix.php == '8.0' && matrix.laravel == '8.*'
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
composer require php-coveralls/php-coveralls
vendor/bin/php-coveralls -v --coverage_clover=build/logs/clover.xml