Skip to content

Commit ef191d6

Browse files
committed
Add mssql workflow job
1 parent 180c42c commit ef191d6

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

.github/workflows/tests.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,61 @@ jobs:
182182
DB_USERNAME: pulse
183183
DB_PASSWORD: password
184184

185+
mssql:
186+
runs-on: ubuntu-22.04
187+
188+
services:
189+
sqlsrv:
190+
image: mcr.microsoft.com/mssql/server:2019-latest
191+
env:
192+
ACCEPT_EULA: Y
193+
SA_PASSWORD: Password123
194+
ports:
195+
- 1433:1433
196+
redis:
197+
image: redis
198+
ports:
199+
- 6379:6379
200+
options: --entrypoint redis-server
201+
202+
strategy:
203+
fail-fast: true
204+
matrix:
205+
php: [8.3]
206+
laravel: [11]
207+
stability: [prefer-stable]
208+
209+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Stability ${{ matrix.stability }} - SQL Server 2019
210+
211+
steps:
212+
- name: Checkout code
213+
uses: actions/checkout@v4
214+
215+
- name: Setup PHP
216+
uses: shivammathur/setup-php@v2
217+
with:
218+
php-version: ${{ matrix.php }}
219+
extensions: dom, curl, libxml, mbstring, redis, pcntl, zip
220+
ini-values: error_reporting=E_ALL
221+
tools: composer:v2
222+
coverage: none
223+
224+
- name: Install redis-cli
225+
run: sudo apt-get install -qq redis-tools
226+
227+
- name: Install dependencies
228+
run: |
229+
composer require "illuminate/contracts=^${{ matrix.laravel }}" --dev --no-update
230+
composer update --prefer-dist --no-interaction --no-progress
231+
232+
- name: Execute tests
233+
run: vendor/bin/pest
234+
env:
235+
DB_CONNECTION: sqlsrv
236+
DB_DATABASE: master
237+
DB_USERNAME: SA
238+
DB_PASSWORD: Password123
239+
185240
sqlite:
186241
runs-on: ubuntu-22.04
187242

database/migrations/2023_06_07_000001_create_pulse_tables.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function up(): void
2424
'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
2525
'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'),
2626
'sqlite' => $table->string('key_hash'),
27+
'sqlsrv' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
2728
};
2829
$table->mediumText('value');
2930

@@ -41,6 +42,7 @@ public function up(): void
4142
'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
4243
'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'),
4344
'sqlite' => $table->string('key_hash'),
45+
'sqlsrv' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
4446
};
4547
$table->bigInteger('value')->nullable();
4648

@@ -60,6 +62,7 @@ public function up(): void
6062
'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
6163
'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'),
6264
'sqlite' => $table->string('key_hash'),
65+
'sqlsrv' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
6366
};
6467
$table->string('aggregate');
6568
$table->decimal('value', 20, 2);

src/Support/PulseMigration.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Laravel\Pulse\Support;
44

5-
use Illuminate\Database\Connection;
65
use Illuminate\Database\Migrations\Migration;
76
use Illuminate\Support\Facades\App;
87
use Illuminate\Support\Facades\Config;
@@ -24,7 +23,7 @@ public function getConnection(): ?string
2423
*/
2524
protected function shouldRun(): bool
2625
{
27-
if (in_array($this->driver(), ['mariadb', 'mysql', 'pgsql', 'sqlite'])) {
26+
if (in_array($this->driver(), ['mariadb', 'mysql', 'pgsql', 'sqlite', 'sqlsrv'])) {
2827
return true;
2928
}
3029

0 commit comments

Comments
 (0)