Skip to content

Commit d60e358

Browse files
committed
Falling back to Github Action for Oracle with wnameless/oracle-xe-11g-r2
1 parent 6430909 commit d60e358

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -365,29 +365,28 @@ jobs:
365365
phpunit-oci8:
366366
name: "PHPUnit on OCI8"
367367
runs-on: "ubuntu-latest"
368-
container: "moufmouf/oracle-xe-php:7.4-11g"
369368

370369
strategy:
371370
matrix:
372371
php-version:
373372
- "7.4"
374373

375-
# services:
376-
# oracle:
377-
# image: "wnameless/oracle-xe-11g-r2"
378-
# ports:
379-
# - "1521:1521"
374+
services:
375+
oracle:
376+
image: "wnameless/oracle-xe-11g-r2"
377+
ports:
378+
- "1521:1521"
380379

381380
steps:
382381
- name: "Checkout"
383382
uses: "actions/checkout@v2"
384383

385-
# - name: "Install PHP"
386-
# uses: "shivammathur/setup-php@v2"
387-
# with:
388-
# php-version: "${{ matrix.php-version }}"
389-
# extensions: "oci8"
390-
# coverage: "pcov"
384+
- name: "Install PHP"
385+
uses: "shivammathur/setup-php@v2"
386+
with:
387+
php-version: "${{ matrix.php-version }}"
388+
extensions: "oci8"
389+
coverage: "pcov"
391390

392391
- name: "Cache dependencies installed with composer"
393392
uses: "actions/cache@v1"
@@ -396,17 +395,6 @@ jobs:
396395
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
397396
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
398397

399-
# - name: "Setup Oracle user"
400-
# run: |
401-
# docker exec $(docker ps -aqf "ancestor=wnameless/oracle-xe-11g-r2") bash -c "export PS1=1 && source /etc/bash.bashrc && source /root/.bashrc && sqlplus -L -S sys/oracle AS SYSDBA <<<SQL \
402-
# create user tdbm_admin identified by tdbm quota unlimited on USERS default tablespace USERS; \
403-
# GRANT CONNECT,RESOURCE TO tdbm_admin; \
404-
# GRANT dba TO tdbm_admin WITH ADMIN OPTION; \
405-
# grant create session, create procedure, create type, create table, create sequence, create view to tdbm_admin; \
406-
# grant select any dictionary to tdbm_admin; \
407-
# exit \
408-
# SQL"
409-
410398
- name: "Install dependencies with composer"
411399
run: "composer install --no-interaction --no-progress --no-suggest"
412400

src/Utils/TDBMDaoGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use function strpos;
2929
use function substr;
3030
use function var_export;
31+
use const PHP_EOL;
3132

3233
/**
3334
* This class generates automatically DAOs and Beans for TDBM.

tests/oracle/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM thecodingmachine/php:7.4-v3-cli
2+
3+
USER root
4+
RUN apt-get update && apt-get install wget
5+
6+
RUN mkdir /opt/oracle
7+
RUN cd /opt/oracle && wget https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip && wget https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip
8+
RUN cd /tmp && wget https://pecl.php.net/get/oci8-2.2.0.tgz
9+
10+
RUN cd /opt/oracle && unzip instantclient-basic-linux.x64-19.6.0.0.0dbru.zip && unzip instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip && echo /opt/oracle/instantclient_19_6 > /etc/ld.so.conf.d/oracle-instantclient.conf
11+
RUN ldconfig
12+
13+
RUN apt-get install -y php-dev php-pear build-essential libaio1
14+
15+
RUN cd /tmp && tar zxf oci8-2.2.0.tgz && cd oci8-2.2.0 && phpize && ./configure --with-oci8=instantclient,/opt/oracle/instantclient_19_6 && make && make install
16+
17+
RUN echo extension=oci8.so > /etc/php/7.4/mods-available/oci8.ini
18+
RUN cd /etc/php/7.4/cli/conf.d/ && ln -s /etc/php/7.4/mods-available/oci8.ini
19+
RUN rm -rf /tmp/oci8-2.2.0 /tmp/oci8-2.2.0.tgz /opt/oracle/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip /opt/oracle/instantclient-sdk-linuxx64.zip
20+
21+
ENV PHP_EXTENSIONS_XDEBUG=1
22+
23+
USER docker

0 commit comments

Comments
 (0)