diff --git a/.github/workflows/build-oracle.yml b/.github/workflows/build-oracle.yml new file mode 100644 index 0000000..79dd54c --- /dev/null +++ b/.github/workflows/build-oracle.yml @@ -0,0 +1,43 @@ +on: + pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + + push: + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + +name: build-oracle + +jobs: + oracle: + name: Oracle tests. + uses: php-forge/actions/.github/workflows/phpunit-database.yml@main + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + concurrency-group: oracle-${{ github.ref }} + database-env: | + { + "ORACLE_DATABASE": "yiitest", + "ORACLE_PASSWORD": "root" + } + database-health-cmd: "healthcheck.sh" + database-health-retries: 10 + database-image: gvenzl/oracle-free + database-port: 1521 + database-type: oci + database-versions: '["23"]' + enable-concurrency: true + extensions: pdo, pdo_oci + os: '["ubuntu-latest"]' + php-version: '["8.4"]' + phpunit-group: oci diff --git a/tests/TestCase.php b/tests/TestCase.php index 58c9e0e..521ee5d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -178,11 +178,18 @@ protected function createDatabase(): void $command->dropTable('multiple_tree')->execute(); } + $primaryKey = $this->driverName === 'oci' + ? 'NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY' + : $this->primaryKey()->notNull(); + $name = $this->driverName === 'oci' + ? $this->string()->notNull() + : $this->text()->notNull(); + $command->createTable( 'tree', [ - 'id' => $this->primaryKey()->notNull(), - 'name' => $this->text()->notNull(), + 'id' => $primaryKey, + 'name' => $name, 'lft' => $this->integer()->notNull(), 'rgt' => $this->integer()->notNull(), 'depth' => $this->integer()->notNull(), @@ -192,9 +199,9 @@ protected function createDatabase(): void $command->createTable( 'multiple_tree', [ - 'id' => $this->primaryKey()->notNull(), + 'id' => $primaryKey, 'tree' => $this->integer(), - 'name' => $this->text()->notNull(), + 'name' => $name, 'lft' => $this->integer()->notNull(), 'rgt' => $this->integer()->notNull(), 'depth' => $this->integer()->notNull(), diff --git a/tests/oracle/CacheManagementTest.php b/tests/oracle/CacheManagementTest.php new file mode 100644 index 0000000..96949d7 --- /dev/null +++ b/tests/oracle/CacheManagementTest.php @@ -0,0 +1,17 @@ +