Skip to content

Merge pull request #24 from php/bool #77

Merge pull request #24 from php/bool

Merge pull request #24 from php/bool #77

Workflow file for this run

name: Build and Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
# XXX: macOS
ubuntu:
strategy:
matrix:
version: ['7.3', '7.4', '8.0', '8.1', '8.2']
runs-on: ubuntu-latest
services:
ibm_db2:
image: "icr.io/db2_community/db2:11.5.8.0"
env:
DB2INST1_PASSWORD: "password"
LICENSE: "accept"
DBNAME: "sample"
options: "--privileged=true"
ports:
- "60000:50000"
volumes:
- database:/database
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache DB2 library
id: cache-clidriver
uses: actions/cache@v2
with:
path: clidriver
key: ${{ runner.os }}-clidriver
- name: Install DB2 library
if: steps.cache-clidriver.outputs.cache-hit != 'true'
run: |
wget https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
tar xvzf linuxx64_odbc_cli.tar.gz
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.version}}
extensions: pdo
- name: phpize
run: phpize
- name: configure
run: ./configure --with-pdo-ibm=$PWD/clidriver
- name: make
run: make V=1
- name: Set up Db2 LUW in Docker
run: |
set -x
cat <<EOF > db2cli.ini
[SAMPLE]
Hostname=localhost
Protocol=TCPIP
Port=60000
Database=sample
EOF
mkdir database
- name: "Perform healthcheck on db2 service"
run: "docker logs -f ${{ job.services.ibm_db2.id }} | sed '/(*) Setup has completed./ q'"
- name: Tests
# make test is insufficient to load PDO
# Most of these are either cribbed from the old Travis configuration,
# or required for the tests to use the DSN.
run: |
export TEST_PHP_ARGS="-n -d extension=pdo.so -d extension=modules/pdo_ibm.so"
export DISABLE_SKIP_CACHE=1
export IBM_DB2_TEST_SKIP_CONNECT_FAILURE=0
export DB2CLIINIPATH=$PWD
export REPORT_EXIT_STATUS=1
export PDOTEST_DSN=ibm:DSN=SAMPLE
export PDOTEST_USER=db2inst1
export PDOTEST_PASS=password
php run-tests.php -P --show-diff tests
- name: Verify package
run: pecl package-validate
windows:
defaults:
run:
shell: cmd
strategy:
matrix:
version: ["7.4", "8.0", "8.1", "8.2"]
arch: [x64]
ts: [ts]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache DB2 library
id: cache-clidriver
uses: actions/cache@v2
with:
path: clidriver
key: ${{ runner.os }}-clidriver
- name: Install DB2 library
if: steps.cache-clidriver.outputs.cache-hit != 'true'
shell: pwsh
run: |
Invoke-WebRequest -Uri 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip' -OutFile 'ntx64_odbc_cli.zip'
Expand-Archive 'ntx64_odbc_cli.zip' -DestinationPath '.\'
- name: Setup PHP
id: setup-php
uses: cmb69/[email protected]
with:
version: ${{matrix.version}}
arch: ${{matrix.arch}}
ts: ${{matrix.ts}}
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
toolset: ${{steps.setup-php.outputs.toolset}}
- name: phpize
run: phpize
- name: configure
run: configure --with-pdo-ibm=%cd%\clidriver --with-prefix=${{steps.setup-php.outputs.prefix}}
- name: make
run: nmake
# XXX: Can we run Docker containers in a Windows runner? That'll be required for tests
#- name: test
# run: nmake test TESTS=tests