Skip to content

Commit

Permalink
ci: use common MSSQL workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Oct 23, 2024
1 parent a5e3a51 commit 5c434ec
Showing 1 changed file with 3 additions and 81 deletions.
84 changes: 3 additions & 81 deletions .github/workflows/ci-mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,10 @@ on: # yamllint disable-line rule:truthy
- '*.*.*'
pull_request: null

name: ci-mssql
name: MSSQL tests

jobs:
tests:
name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }}

env:
key: cache

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- php: '8.0'
extensions: pdo, pdo_sqlsrv
mssql: 'server:2017-latest'
- php: '8.1'
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'
odbc-version: 18
flag: "-C"
- php: '8.2'
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'
odbc-version: 18
flag: "-C"
- php: '8.3'
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'
odbc-version: 18
flag: "-C"

services:
mssql:
image: mcr.microsoft.com/mssql/${{ matrix.mssql }}
env:
SA_PASSWORD: SSpaSS__1
ACCEPT_EULA: Y
MSSQL_PID: Developer
ports:
- 11433:1433
options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.odbc-version }}/bin/sqlcmd ${{ matrix.flag }} -S localhost -U SA -P 'SSpaSS__1' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: date.timezone='UTC'
tools: composer:v2, pecl

- name: Determine composer cache directory on Linux
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer
if: matrix.php != '8.3'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.3
if: matrix.php == '8.3'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit without coverage
env:
DB: sqlserver
run: vendor/bin/phpunit --group driver-sqlserver --colors=always
phpunit:
uses: cycle/gh-actions/.github/workflows/db-mssql.yml@master

...

0 comments on commit 5c434ec

Please sign in to comment.