-
-
Notifications
You must be signed in to change notification settings - Fork 38
188 lines (142 loc) · 4.2 KB
/
Build.yml
File metadata and controls
188 lines (142 loc) · 4.2 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Build
on:
push:
branches: ['main']
pull_request:
branches: ['main']
workflow_dispatch:
jobs:
PHPUnit:
strategy:
fail-fast: false
matrix:
php_versions: ['8.4']
runs-on: ubuntu-latest
name: PHPUnit - PHP ${{ matrix.php_versions }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_versions }}
extensions: mbstring, dom, fileinfo, gd
coverage: xdebug
tools: pecl, composer
- name: Install Dependencies
run: composer install --prefer-dist --no-progress
- name: Execute tests
run: |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
vendor/bin/phpunit
- name: Upload coverage to Codecov
if: github.event_name != 'schedule'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./_meta/coverage.xml
fail_ci_if_error: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
files: ./_meta/junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
PHPStan:
strategy:
fail-fast: false
matrix:
php_versions: ['8.4']
runs-on: ubuntu-latest
name: PHPStan - PHP ${{ matrix.php_versions }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_versions }}
- name: Install Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run PHPStan
run: vendor/bin/phpstan analyse
Vite:
strategy:
fail-fast: false
matrix:
node_versions: [24]
runs-on: ubuntu-latest
name: Vite Build - Node ${{ matrix.node_versions }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_versions }}
- name: Install Dependencies
run: npm ci
- name: Test
run: npm run vite:build
Vitest:
strategy:
fail-fast: false
matrix:
node_versions: [24]
runs-on: ubuntu-latest
name: Vitest - Node ${{ matrix.node_versions }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_versions }}
- name: Install Dependencies
run: npm ci
- name: Run Tests with Coverage
run: npm run coverage
- name: Upload coverage to Codecov
if: github.event_name != 'schedule'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./_meta/frontend-coverage/lcov.info
fail_ci_if_error: true
Prettier:
strategy:
fail-fast: false
matrix:
node_versions: [24]
runs-on: ubuntu-latest
name: Prettier - Node ${{ matrix.node_versions }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_versions }}
- name: Install Dependencies
run: npm ci
- name: Prettier dry run
run: npm run format-dry-run
- name: TypeCheck
run: npm run typecheck
- name: Eslint
run: npm run lint
PHP-CS-Fixer:
runs-on: ubuntu-latest
name: PHP-CS-Fixer
steps:
- uses: actions/checkout@v4
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run
Deploy:
name: Deploy code to prod
runs-on: ubuntu-latest
needs: [PHPUnit, PHPStan, Vite, Vitest, Prettier, PHP-CS-Fixer]
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: deployphp/action@v1
with:
deployer-version: "7.3.0"
dep: deploy prod -f .github/deploy.php
private-key: ${{ secrets.PRIVATE_KEY }}