Skip to content

Commit

Permalink
fix: ci/cd - tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yajra committed Jul 1, 2023
1 parent 00ceb8e commit f60a5fa
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1, 8.2]
php: [8.1, 8.2]
stability: [prefer-stable]

name: PHP ${{ matrix.php }} - STABILITY ${{ matrix.stability }}
Expand All @@ -43,12 +43,12 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Setup OCI8 for PHP 8.1
run: ./oci8-php81.sh
if: matrix.php > 8
run: ./oci81.sh
if: matrix.php == 8.1

- name: Setup OCI8 for PHP 8
run: ./oci8-php8.sh
if: matrix.php == 8
- name: Setup OCI8 for PHP 8.2
run: ./oci82.sh
if: matrix.php == 8.2

- name: Set Minimum PDO-VIA-OCI8 Version
uses: nick-invision/retry@v1
Expand All @@ -66,4 +66,4 @@ jobs:
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --verbose
run: vendor/bin/phpunit
28 changes: 28 additions & 0 deletions oci81.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

# install deps
sudo apt-get update -qq
sudo apt-get -y install -qq build-essential unzip wget libaio1

# install oci8 libs & extension
sudo mkdir -p /opt/oracle

wget https://github.com/bumpx/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip
wget https://github.com/bumpx/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-12.1.0.2.0.zip

sudo unzip -o ./instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle
sudo unzip -o ./instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle

sudo ln -s /opt/oracle/instantclient/sqlplus /usr/bin/sqlplus
sudo ln -s /opt/oracle/instantclient_12_1 /opt/oracle/instantclient
sudo ln -s /opt/oracle/instantclient/libclntsh.so.12.1 /opt/oracle/instantclient/libclntsh.so
sudo ln -s /opt/oracle/instantclient/libocci.so.12.1 /opt/oracle/instantclient/libocci.so

sudo sh -c "echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8-3.2.1"

# setup ld library path
sudo sh -c "echo '/opt/oracle/instantclient' >> /etc/ld.so.conf"
sudo ldconfig

# enable oci8 extension
sudo sh -c "echo 'extension=oci8.so' >> /etc/php/8.1/cli/php.ini"
3 changes: 3 additions & 0 deletions oci8-php81.sh → oci82.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ sudo sh -c "echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8"
# setup ld library path
sudo sh -c "echo '/opt/oracle/instantclient' >> /etc/ld.so.conf"
sudo ldconfig

# enable oci8 extension
sudo sh -c "echo 'extension=oci8.so' >> /etc/php/8.2/cli/php.ini"

0 comments on commit f60a5fa

Please sign in to comment.