-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (88 loc) 路 3.11 KB
/
Copy pathtests.yml
File metadata and controls
105 lines (88 loc) 路 3.11 KB
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
97
98
99
100
101
102
103
104
105
name: Tests
on:
push:
jobs:
phpunit:
name: ${{ matrix.php-versions }} - ${{ matrix.stability }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.0' ]
stability: [ 'prefer-stable' ]
services:
redis:
image: redis:5.0-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, gd, gmp
key: cache-v1
- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, gd, gmp
coverage: xdebug
tools: phpunit, composer:v2
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Set Minimum PHP 8.0 Versions
uses: nick-invision/retry@v2.8.3
with:
timeout_minutes: 5
max_attempts: 5
command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update
if: matrix.php-versions >= 8
- name: Set Minimum PHP 8.1 Versions
uses: nick-invision/retry@v2.8.3
with:
timeout_minutes: 5
max_attempts: 5
command: composer require symfony/symfony:5.4.x-dev league/commonmark:^2.0.2 phpunit/phpunit:^9.5.8 --no-interaction --no-update
if: matrix.php-versions >= 8.1
- name: Install dependencies
uses: nick-invision/retry@v2.8.3
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Prepare for environment variables
run: |
cp .env.testing .env
composer dump-autoload
- name: Run Testsuite
run: vendor/bin/pest tests/ --coverage-text --colors=always --coverage-html=coverage --coverage-clover coverage.xml
env:
REDIS_HOST: 127.0.0.1
REDIS_PASSWORD:
REDIS_PORT: 6379
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}