Skip to content

Fix path to mssql-tools #8

Fix path to mssql-tools

Fix path to mssql-tools #8

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
phpcs:
name: Code style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: phpcs
- name: Check production code style
run: composer cs-prod
- name: Check test code style
run: composer cs-tests
tests:
name: Unit tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: codeception_test
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: codeception_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: P@ssw0rd
ACCEPT_EULA: 'Y'
ports:
- 1433:1433
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'P@ssw0rd' -d master -Q 'SELECT COUNT(*) FROM master.dbo.spt_values;'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
php: [8.0, 8.1, 8.2, 8.3]
steps:
- name: Create default database for sqlsrv as image does not support it
run: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'P@ssw0rd' -Q 'CREATE DATABASE codeception_test'
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo, pgsql, mysql, sqlite, sqlsrv, pdo_sqlsrv, pdo_dblib
coverage: none
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
- name: Run test suite
run: php vendor/bin/codecept run
env:
MYSQL_HOST: 127.0.0.1
MYSQL_DB: codeception_test
PG_HOST: 127.0.0.1
PG_DB: codeception_test
PG_PASSWORD: postgres
MSSQL_HOST: 127.0.0.1
MSSQL_DB: codeception_test
MSSQL_PASSWORD: P@ssw0rd