Skip to content

Commit

Permalink
Add mssql workflow job
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Mar 13, 2024
1 parent 180c42c commit ef191d6
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,61 @@ jobs:
DB_USERNAME: pulse
DB_PASSWORD: password

mssql:
runs-on: ubuntu-22.04

services:
sqlsrv:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Password123
ports:
- 1433:1433
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server

strategy:
fail-fast: true
matrix:
php: [8.3]
laravel: [11]
stability: [prefer-stable]

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Stability ${{ matrix.stability }} - SQL Server 2019

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, redis, pcntl, zip
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none

- name: Install redis-cli
run: sudo apt-get install -qq redis-tools

- name: Install dependencies
run: |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --dev --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/pest
env:
DB_CONNECTION: sqlsrv
DB_DATABASE: master
DB_USERNAME: SA
DB_PASSWORD: Password123

sqlite:
runs-on: ubuntu-22.04

Expand Down
3 changes: 3 additions & 0 deletions database/migrations/2023_06_07_000001_create_pulse_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function up(): void
'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'),
'sqlite' => $table->string('key_hash'),
'sqlsrv' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
};
$table->mediumText('value');

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

Expand All @@ -60,6 +62,7 @@ public function up(): void
'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'),
'sqlite' => $table->string('key_hash'),
'sqlsrv' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
};
$table->string('aggregate');
$table->decimal('value', 20, 2);
Expand Down
3 changes: 1 addition & 2 deletions src/Support/PulseMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Laravel\Pulse\Support;

use Illuminate\Database\Connection;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Config;
Expand All @@ -24,7 +23,7 @@ public function getConnection(): ?string
*/
protected function shouldRun(): bool
{
if (in_array($this->driver(), ['mariadb', 'mysql', 'pgsql', 'sqlite'])) {
if (in_array($this->driver(), ['mariadb', 'mysql', 'pgsql', 'sqlite', 'sqlsrv'])) {
return true;
}

Expand Down

0 comments on commit ef191d6

Please sign in to comment.