-
-
Notifications
You must be signed in to change notification settings - Fork 15
132 lines (113 loc) · 3.27 KB
/
pest.yml
File metadata and controls
132 lines (113 loc) · 3.27 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Pest
on:
pull_request:
branches: [main]
push:
branches: [main, "feature/**"]
jobs:
build:
name: Build Laravel App
runs-on: ubuntu-latest
outputs:
artifact-name: app-artifact
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Bootstrap Laravel App
run: |
php ci.php
mkdir -p storage/app storage/framework storage/logs
touch storage/.gitkeep
touch database/database.sqlite
- name: Upload Build Artifact
uses: actions/upload-artifact@v5
with:
name: app-artifact
path: app-artifact.tar.gz
pest:
name: Pest (PHP ${{ matrix.php }} on ${{ matrix.os }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.3, 8.4]
os: [ubuntu-latest]
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@v5
- name: Download App Artifact
uses: actions/download-artifact@v6
with:
name: app-artifact
path: .
- name: Extract Artifact
run: tar -xzf app-artifact.tar.gz
- name: Composer dump-autoload
run: composer dump-autoload -o -vvv
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer
- 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@v5
with:
name: clover-report-${{ matrix.php }}
path: clover.xml
codacy:
name: Codacy Coverage
needs: pest
runs-on: ubuntu-latest
steps:
- name: Download Coverage Report
uses: actions/download-artifact@v6
with:
name: clover-report-8.4
- 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:
- name: Download Coverage Report
uses: actions/download-artifact@v6
with:
name: clover-report-8.4
- name: QLTY Coverage
uses: qltysh/qlty-action/coverage@v2
with:
token: ${{ secrets.QLTY }}
files: clover.xml