-
Notifications
You must be signed in to change notification settings - Fork 4
109 lines (94 loc) · 3.27 KB
/
ci.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
97
98
99
100
101
102
103
104
105
106
107
108
on: push
name: tests
jobs:
linux_tests:
runs-on: ubuntu-22.04
timeout-minutes: 10
services:
memcached:
image: memcached:1.6-alpine
ports:
- 11211:11211
mysql:
image: mysql:8.4
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: forge
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: true
matrix:
php: ['8.2', '8.3']
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
steps:
- name: Verify unittest DB exists
run: mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -e "SHOW DATABASES LIKE 'forge'"
- name: Show MySQL Database
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
mysql --host $DB_HOST --port $DB_PORT -uroot -e "SHOW DATABASES"
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, memcached, pcov
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: pcov
# - name: Set Minimum PHP 8.3 Versions
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 5
# max_attempts: 5
# command: composer require guzzlehttp/guzzle:^7.9 --no-interaction --no-update
# if: matrix.php >= 8.3
# - name: Set Minimum PHP 8.2 Versions
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 5
# max_attempts: 5
# command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update
# if: matrix.php >= 8.2
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Remove recursive symlink if it exists
run: rm -f vendor/orchestra/testbench-core/laravel/vendor
- name: Execute tests
run: vendor/bin/phpunit --coverage-clover './clover.xml'
env:
DB_CONNECTION: testing
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
DB_PASSWORD: ""
DB_DATABASE: forge
- name: Upload coverage to Codecov
if: ${{ matrix.stability == 'prefer-stable' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: .
fail_ci_if_error: true
files: ./clover.xml
name: codecov-umbrella
path_to_write_report: ./codecov_report.txt
verbose: true
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: logs
path: |
./codecov_report.txt
vendor/orchestra/testbench-core/laravel/storage/logs
!vendor/**/.gitignore