diff --git a/.github/workflows/ci-mssql.yml b/.github/workflows/ci-mssql.yml index 169d5a4b9d9..08ce49057bb 100644 --- a/.github/workflows/ci-mssql.yml +++ b/.github/workflows/ci-mssql.yml @@ -10,7 +10,7 @@ concurrency: jobs: tests: - name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }} + name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql.version }} env: EXTENSIONS: pdo, pdo_sqlsrv @@ -21,37 +21,45 @@ jobs: strategy: fail-fast: false matrix: + php: + - 7.4 + - 8.0 + - 8.1 + - 8.2 + - 8.3 + - 8.4 + + mssql: + - version: server:2022-latest + mssql-tool: /opt/mssql-tools18/bin/sqlcmd -C + include: - php: 7.4 - mssql: server:2017-latest + mssql: + version: server:2017-latest + mssql-tool: /opt/mssql-tools/bin/sqlcmd - php: 8.0 - mssql: server:2019-latest - - php: 8.1 - mssql: server:2019-latest - - php: 8.2 - mssql: server:2022-latest - - php: 8.3 - mssql: server:2022-latest - - php: 8.4 - mssql: server:2022-latest + mssql: + version: server:2019-latest + mssql-tool: /opt/mssql-tools18/bin/sqlcmd -C services: mssql: - image: mcr.microsoft.com/mssql/${{ matrix.mssql }} + image: mcr.microsoft.com/mssql/${{ matrix.mssql.version }} env: SA_PASSWORD: YourStrong!Passw0rd ACCEPT_EULA: Y MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="${{ matrix.mssql.mssql-tool }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout uses: actions/checkout@v4 - name: Create MS SQL Database - run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql ${{ matrix.mssql.mssql-tool }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions uses: shivammathur/setup-php@v2