-
Notifications
You must be signed in to change notification settings - Fork 4
Add workflow for PHPUnit without database testing #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e7e7b0f to
891fb54
Compare
Member
Author
--- phpunit.yml 2023-09-14 10:12:41.000000000 +0900
+++ phpunit-no-db.yml 2023-09-14 10:12:49.000000000 +0900
@@ -1,4 +1,4 @@
-# This workflow runs tests on all databases supported by CI4.
+# This workflow is for packages without database testing.
name: PHPUnit
on:
@@ -29,107 +29,15 @@
jobs:
main:
- name: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }} - ${{ matrix.dependencies }}
+ name: PHP ${{ matrix.php-versions }} Unit Tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
- db-platforms: ['MySQLi', 'SQLite3']
- mysql-versions: ['5.7']
- dependencies: ['highest']
- include:
- # MySQL 8.0
- - php-versions: '7.4'
- db-platforms: MySQLi
- mysql-versions: '8.0'
- dependencies: 'highest'
- # Lowest Dependency
- - php-versions: '7.4'
- db-platforms: MySQLi
- mysql-versions: '5.7'
- dependencies: 'lowest'
- # Postgre
- - php-versions: '7.4'
- db-platforms: Postgre
- mysql-versions: '5.7'
- dependencies: 'highest'
- # SQLSRV
- - php-versions: '7.4'
- db-platforms: SQLSRV
- mysql-versions: '5.7'
- dependencies: 'highest'
- # OCI8
- - php-versions: '7.4'
- db-platforms: OCI8
- mysql-versions: '5.7'
- dependencies: 'highest'
-
- services:
- mysql:
- image: mysql:${{ matrix.mysql-versions }}
- env:
- MYSQL_ALLOW_EMPTY_PASSWORD: yes
- MYSQL_DATABASE: test
- ports:
- - 3306:3306
- options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
-
- postgres:
- image: postgres
- env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- POSTGRES_DB: test
- ports:
- - 5432:5432
- options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
-
- mssql:
- image: mcr.microsoft.com/mssql/server:2019-CU10-ubuntu-20.04
- env:
- SA_PASSWORD: 1Secure*Password1
- ACCEPT_EULA: Y
- MSSQL_PID: Developer
- ports:
- - 1433:1433
- options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q 'SELECT @@VERSION'" --health-interval=10s --health-timeout=5s --health-retries=3
-
- oracle:
- image: quillbuilduser/oracle-18-xe
- env:
- ORACLE_ALLOW_REMOTE: true
- ports:
- - 1521:1521
- options: --health-cmd="/opt/oracle/product/18c/dbhomeXE/bin/sqlplus -s sys/Oracle18@oracledbxe/XE as sysdba <<< 'SELECT 1 FROM DUAL'" --health-interval=10s --health-timeout=5s --health-retries=3
+ dependencies: ['highest', 'lowest']
steps:
- - name: Create database for MSSQL Server
- 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
@@ -138,7 +46,7 @@
with:
php-version: ${{ matrix.php-versions }}
tools: composer, phive, phpunit
- extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3, sqlsrv, oci8, pgsql
+ extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3
coverage: xdebug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -166,7 +74,6 @@
- name: Test with PHPUnit
run: vendor/bin/phpunit --verbose --coverage-text --testsuite main
env:
- DB: ${{ matrix.db-platforms }}
TERM: xterm-256color
TACHYCARDIA_MONITOR_GA: enabled
@@ -179,7 +86,7 @@
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
- COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
+ COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }}
coveralls:
needs: [main] |
1 task
9 tasks
Member
|
Thank you! Looks good. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
codeigniter4/cachedoes not need database testing.See codeigniter4/cache#18 (comment)
Checklist: