This repository has been archived by the owner on Jul 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
96 lines (80 loc) · 2.99 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This is a basic workflow to help you get started with Actions
name: Tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [7.3, 7.4, 8.0]
laravel: ['7.*', '8.*']
name: 'PHP ${{ matrix.php }} / laravel ${{ matrix.laravel }}'
steps:
- uses: actions/checkout@master
# set timezone because browser test TimeRange
- name: Set time zone
run: sudo timedatectl set-timezone Asia/Shanghai
# Configure PHP
- name: Select PHP version
uses: shivammathur/setup-php@master
with:
php-version: '${{ matrix.php }}'
extensions: mbstring, pdo_sqlite, fileinfo, gd, xdebug
coverage: xdebug
# Install PHP dependencies
- name: Install Composer dependencies
run: composer require "laravel/framework:${{ matrix.laravel }}"
# Install legacy factories for Laravel 8
# - name: Install legacy factories for Laravel
# if: ${{ matrix.laravel == '8.*' }}
# run: composer require laravel/legacy-factories
# Display installed laravel version
- name: Install Composer
run: composer install
- name: Start Chrome Driver
run: ./vendor/bin/dusk-updater detect --auto-update &&
./vendor/laravel/dusk/bin/chromedriver-linux &
- name: Show laravel version
run: composer show laravel/framework
# Run phpunit tests
- if: ${{ matrix.laravel == '7.*' }}
name: Run tests in Laravel 7.x
run: ./vendor/bin/phpunit --configuration=phpunit-laravel7.xml --coverage-clover build/logs/clover.xml
- if: ${{ matrix.laravel != '7.*' }}
name: Run tests in Laravel 8.x
run: ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Upload Failed Screenshots
uses: actions/upload-artifact@v2-preview
if: failure()
with:
name: screenshots
path: tests/Browser/screenshots/*
- name: Install PHP Coveralls library
env:
PHP_VERSION: ${{ matrix.php }}
run: composer global require --dev php-coveralls/php-coveralls
- name: Upload coverage results to Coveralls
env:
PHP_VERSION: ${{ matrix.php }}
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: php-${{ matrix.php }}
run: php-coveralls -v
coveralls-finish:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true