Skip to content

Commit

Permalink
fix: oracle for GitHub Action (#33)
Browse files Browse the repository at this point in the history
* Update phpunit.yml

* Update phpunit.yml
  • Loading branch information
datamweb authored Oct 5, 2024
1 parent 5f84c9c commit 50e468c
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ on:
- 'composer.*'
- 'phpunit*'
- '.github/workflows/phpunit.yml'

env:
NLS_LANG: 'AMERICAN_AMERICA.UTF8'
NLS_DATE_FORMAT: 'YYYY-MM-DD HH24:MI:SS'
NLS_TIMESTAMP_FORMAT: 'YYYY-MM-DD HH24:MI:SS'
NLS_TIMESTAMP_TZ_FORMAT: 'YYYY-MM-DD HH24:MI:SS'

jobs:
main:
name: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }} - ${{ matrix.dependencies }}
Expand Down Expand Up @@ -106,28 +111,6 @@ jobs:
if: matrix.db-platforms == 'SQLSRV'
run: sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test"

- name: Install Oracle InstantClient
if: matrix.db-platforms == 'OCI8'
run: |
sudo apt-get install wget libaio1 alien
sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm
sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm
sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm
sudo alien oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm
sudo alien oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm
sudo alien oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm
sudo dpkg -i oracle-instantclient18.5-basic_18.5.0.0.0-4_amd64.deb oracle-instantclient18.5-devel_18.5.0.0.0-4_amd64.deb oracle-instantclient18.5-sqlplus_18.5.0.0.0-4_amd64.deb
echo "LD_LIBRARY_PATH=/lib/oracle/18.5/client64/lib/" >> $GITHUB_ENV
echo "NLS_LANG=AMERICAN_AMERICA.UTF8" >> $GITHUB_ENV
echo "C_INCLUDE_PATH=/usr/include/oracle/18.5/client64" >> $GITHUB_ENV
echo 'NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV
echo 'NLS_TIMESTAMP_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV
echo 'NLS_TIMESTAMP_TZ_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV
- name: Create database for Oracle Database
if: matrix.db-platforms == 'OCI8'
run: echo -e "ALTER SESSION SET CONTAINER = XEPDB1;\nCREATE BIGFILE TABLESPACE \"TEST\" DATAFILE '/opt/oracle/product/18c/dbhomeXE/dbs/TEST' SIZE 10M AUTOEXTEND ON MAXSIZE UNLIMITED SEGMENT SPACE MANAGEMENT AUTO EXTENT MANAGEMENT LOCAL AUTOALLOCATE;\nCREATE USER \"ORACLE\" IDENTIFIED BY \"ORACLE\" DEFAULT TABLESPACE \"TEST\" TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON \"TEST\";\nGRANT CONNECT,RESOURCE TO \"ORACLE\";\nexit;" | /lib/oracle/18.5/client64/bin/sqlplus -s sys/Oracle18@localhost:1521/XE as sysdba

- name: Checkout
uses: actions/checkout@v4

Expand Down

0 comments on commit 50e468c

Please sign in to comment.