Skip to content

Commit 21278da

Browse files
committed
Attempt to use Docker container for tests
1 parent d73c280 commit 21278da

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,42 @@ jobs:
3737
run: ./configure --with-IBM_DB2=$PWD/clidriver
3838
- name: make
3939
run: make V=1
40-
# XXX: No tests until DB2 Docker container is set up (see Travis)
41-
#- name: Test dbase
42-
# run: make test TESTS=tests
40+
- name: Set up Db2 LUW in Docker
41+
# XXX: Should we be caching the Docker image? Are we creating the necessary things?
42+
# Adapted from the Travis setup with the changes used for the current
43+
# version of the Db2 container.
44+
run: |
45+
set -x
46+
cat <<EOF > db2cli.ini
47+
[SAMPLE]
48+
Hostname=localhost
49+
Protocol=TCPIP
50+
Port=60000
51+
Database=sample
52+
EOF
53+
mkdir database
54+
docker pull ibmcom/db2
55+
docker run --name db2 --privileged=true -p 60000:50000 -e DB2INST1_PASSWORD=password -e LICENSE=accept -e DBNAME=sample -v database:/database -itd ibmcom/db2
56+
docker ps -as
57+
while true
58+
do
59+
if (docker logs db2 | grep 'Setup has completed')
60+
then
61+
break
62+
fi
63+
sleep 20
64+
done
65+
- name: Tests
66+
# make test is insufficient to load PDO
67+
# Most of these are either cribbed from the old Travis configuration,
68+
# or required for the tests to use the DSN.
69+
# Note that connection.inc defaults should be mostly sufficient.
70+
run: |
71+
export TEST_PHP_ARGS="-n -d extension=modules/pdo_ibm.so"
72+
export IBM_DB2_TEST_SKIP_CONNECT_FAILURE=0
73+
export DB2CLIINIPATH=$PWD
74+
export REPORT_EXIT_STATUS=1
75+
php run-tests.php -P --show-diff tests
4376
windows:
4477
defaults:
4578
run:

0 commit comments

Comments
 (0)