-
-
Notifications
You must be signed in to change notification settings - Fork 16
107 lines (92 loc) · 2.77 KB
/
Copy pathpest.yml
File metadata and controls
107 lines (92 loc) · 2.77 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
106
107
name: Pest
on:
pull_request:
branches: [main]
push:
branches: [main, "feature/**"]
jobs:
pest:
name: Pest (PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '8.4'
laravel: '12'
- php: '8.5'
laravel: '13'
fail-fast: false
env:
DB_DATABASE: testing
DB_PASSWORD: secretroot
DB_USER: root
APP_KEY: base64:1NxfrNErQ0vo1ZnPcLeVhnE7tOZdKlKiFORzPA92krM=
services:
mysql:
image: mysql:latest
env:
MYSQL_DATABASE: testing
MYSQL_ROOT_PASSWORD: secretroot
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v7.0.0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer
- name: Bootstrap Laravel App
run: |
php dev.php --laravel=${{ matrix.laravel }} --db=mysql
mkdir -p storage/app storage/framework storage/logs
touch storage/.gitkeep
- name: Composer dump-autoload
run: composer dump-autoload -o -vvv
- name: Fix Permissions (Linux only)
if: runner.os == 'Linux'
run: |
[ -d storage ] && chmod -R 755 storage || echo "⚠️ storage not found"
[ -d bootstrap ] && chmod -R 755 bootstrap || echo "⚠️ bootstrap not found"
chmod +x vendor/bin/pest || true
- name: Run Pest
run: vendor/bin/pest --coverage-clover=clover.xml
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
DB_HOST: 127.0.0.1
- name: Upload Clover
uses: actions/upload-artifact@v7
with:
name: clover-report-${{ matrix.php }}-${{ matrix.laravel }}
path: clover.xml
codacy:
name: Codacy Coverage
needs: pest
runs-on: ubuntu-latest
steps:
- name: Download Coverage Report
uses: actions/download-artifact@v8
with:
name: clover-report-8.4-12
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
api-token: ${{ secrets.CODACY }}
coverage-reports: clover.xml
qlty:
name: Qlty Coverage
needs: pest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.0
- name: Download Coverage Report
uses: actions/download-artifact@v8
with:
name: clover-report-8.4-12
- name: QLTY Coverage
uses: qltysh/qlty-action/coverage@v2
with:
token: ${{ secrets.QLTY }}
files: clover.xml