This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 25
86 lines (73 loc) Β· 3.1 KB
/
tests.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
name: tests
on:
push:
branches: [master, main]
tags-ignore: ['**']
paths-ignore: ['**.md']
pull_request:
paths-ignore: ['**.md']
schedule:
- cron: '0 0 * * 1' # once in a week, docs: <https://git.io/JvxXE#onschedule>
jobs: # Docs: <https://help.github.com/en/articles/workflow-syntax-for-github-actions>
tests:
name: PHP ${{ matrix.php }}, RR ${{ matrix.rr }} (${{ matrix.setup }} setup)
runs-on: ubuntu-20.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
setup: ['basic', 'lowest']
php: ['8.0', '8.1', '8.2']
rr: ['2.12.1'] # Releases: <https://github.com/roadrunner-server/roadrunner/releases>
coverage: ['true']
include:
- php: '8.0'
setup: 'lowest'
rr: '2.0.0'
coverage: 'false'
- php: '8.1'
setup: 'basic'
rr: '2.12.1'
coverage: 'false'
steps:
- uses: actions/checkout@v4
- name: Install RoadRunner Binary
run: docker run --rm -v "/:/rootfs:rw" --entrypoint "" spiralscout/roadrunner:${{ matrix.rr }} cp /usr/bin/rr /rootfs/usr/bin/rr
- uses: shivammathur/setup-php@v2 # Action page: <https://github.com/shivammathur/setup-php>
with:
php-version: ${{ matrix.php }}
extensions: xdebug
- name: Get Composer Cache Directory # Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies # Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install lowest Composer dependencies
if: matrix.setup == 'lowest'
run: composer update --prefer-dist --no-interaction --prefer-lowest --no-progress --ansi
- name: Install basic Composer dependencies
if: matrix.setup == 'basic'
run: composer update --prefer-dist --no-interaction --no-progress --ansi
- name: Install "spatie/laravel-ignition" package
if: ${{ startsWith(matrix.php, '8') && matrix.setup == 'basic' }} # only for php >= 8.0
run: composer require --dev spatie/laravel-ignition
- name: Show most important package versions
run: composer info | grep -e laravel -e spiral -e phpunit/phpunit -e phpstan/phpstan
- name: Execute tests
if: matrix.coverage != 'true'
run: composer test
- name: Execute tests with code coverage
if: matrix.coverage == 'true'
env:
XDEBUG_MODE: coverage
run: composer test-cover
- uses: codecov/codecov-action@v3 # Docs: <https://github.com/codecov/codecov-action>
if: matrix.coverage == 'true'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml
fail_ci_if_error: false