@@ -127,30 +127,39 @@ jobs:
127
127
path : app/storage/logs
128
128
129
129
stub-tests :
130
- runs-on : ubuntu-latest
130
+ runs-on : ${{ matrix.os }}
131
131
132
132
strategy :
133
133
fail-fast : true
134
134
matrix :
135
+ os : [ubuntu-latest, windows-latest]
135
136
php : [8.1, 8.0]
136
137
laravel : [9.*]
137
138
dependency-version : [prefer-lowest, prefer-stable]
138
139
139
- name : Test Stubs P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
140
+ name : Test Stubs ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
140
141
141
142
steps :
142
143
- name : Setup PHP
143
144
uses : shivammathur/setup-php@v2
144
145
with :
145
146
php-version : ${{ matrix.php }}
146
- extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql
147
+ extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql, fileinfo
147
148
coverage : none
148
149
149
150
- name : Setup Laravel
150
151
run : |
151
- composer create-project laravel/laravel:^9 .
152
+ composer create-project laravel/laravel:^9.3 .
152
153
composer require protonemedia/laravel-splade
153
- rm -rf vendor/protonemedia/laravel-splade
154
+
155
+ - name : Remove installed Splade (Unix)
156
+ run : rm -rf vendor/protonemedia/laravel-splade
157
+ if : matrix.os == 'ubuntu-latest'
158
+
159
+ - name : Remove installed Splade (Windows)
160
+ run : rd "vendor/protonemedia/laravel-splade" /s /q
161
+ shell : cmd
162
+ if : matrix.os == 'windows-latest'
154
163
155
164
- name : Checkout code
156
165
uses : actions/checkout@v2
@@ -163,18 +172,53 @@ jobs:
163
172
php artisan splade:install
164
173
165
174
- name : Install NPM dependencies
175
+ run : npm i
176
+
177
+ - name : Remove installed Splade and copy front-end build from Checkout (Unix)
166
178
run : |
167
- npm i
168
179
rm -rf node_modules/@protonemedia/laravel-splade/dist
169
180
cp -R vendor/protonemedia/laravel-splade/dist node_modules/@protonemedia/laravel-splade/
181
+ if : matrix.os == 'ubuntu-latest'
182
+
183
+ - name : Remove installed Splade and copy front-end build from Checkout (Windows)
184
+ run : |
185
+ rd "node_modules/@protonemedia/laravel-splade/dist" /s /q
186
+ mkdir "node_modules/@protonemedia/laravel-splade/dist"
187
+ xcopy "vendor/protonemedia/laravel-splade/dist" "node_modules/@protonemedia/laravel-splade/dist" /E /I
188
+ shell : cmd
189
+ if : matrix.os == 'windows-latest'
170
190
171
191
- name : Compile assets
172
192
run : npm run build
173
193
174
- - name : Start SSR server
194
+ - name : Run Laravel Server (Unix)
195
+ run : php artisan serve &
196
+ if : matrix.os == 'ubuntu-latest'
197
+
198
+ - name : Run Test (Unix)
199
+ run : php vendor/protonemedia/laravel-splade/TestStubs.php
200
+ if : matrix.os == 'ubuntu-latest'
201
+
202
+ - name : Run Laravel Server (Windows) and Run Test
203
+ run : |
204
+ start /b cmd /v:on /c "(php artisan serve) &"
205
+ php vendor/protonemedia/laravel-splade/TestStubs.php
206
+ shell : cmd
207
+ if : matrix.os == 'windows-latest'
208
+
209
+ - name : Start SSR server (Unix)
175
210
run : |
176
211
echo "SPLADE_SSR_ENABLED=true" >> .env
177
212
node bootstrap/ssr/ssr.mjs &
213
+ if : matrix.os == 'ubuntu-latest'
178
214
179
- - name : Run Test command
215
+ - name : Run Test command (Unix)
180
216
run : php artisan splade:ssr-test
217
+ if : matrix.os == 'ubuntu-latest'
218
+
219
+ - name : Start SSR server (Windows) and Run Test command
220
+ run : |
221
+ echo "SPLADE_SSR_ENABLED=true" >> .env
222
+ node bootstrap/ssr/ssr.mjs &
223
+ php artisan splade:ssr-test
224
+ if : matrix.os == 'windows-latest'
0 commit comments