Skip to content
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

add github actions test workflow #2

Merged
merged 7 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: test

on:
push:

jobs:
test:
env:
DB: mysql
DB_USER: root
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
php:
- '5.6'
- '7.2'
- '7.3'
- '7.4'
# - '8.0'
# - '8.1'
composer:
- ''
- '--prefer-lowest'

steps:
- uses: actions/checkout@v2

- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: sqlite3, zip
coverage: xdebug
tools: composer:v1

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-dir)"
working-directory: ./

- name: cache dependencies
id: cache-dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-

- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ./

- name: Install dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
COMPOSER_FLAGS: ${{ matrix.composer }}
run: composer update ${COMPOSER_FLAGS} --prefer-source
working-directory: ./

- name: Start MySQL
run: |
sudo systemctl start mysql
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -proot mysql

- name: Disable MySQL strict mode
run: |
echo "SET GLOBAL sql_mode = ''" | mysql -u root -proot mysql

- name: setup database
run: |
sh -c "if [ '$DB' = 'mysql' ]; then mysql -u root -proot mysql -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS test; DROP SCHEMA IF EXISTS second_hand_books; DROP SCHEMA IF EXISTS contest; DROP DATABASE IF EXISTS reverse_bookstore; DROP SCHEMA IF EXISTS bookstore_schemas; SET FOREIGN_KEY_CHECKS = 1;'; fi"
sh -c "if [ '$DB' = 'mysql' ]; then mysql -u root -proot mysql -e 'CREATE DATABASE test; CREATE SCHEMA bookstore_schemas; CREATE SCHEMA contest; CREATE SCHEMA second_hand_books; CREATE DATABASE reverse_bookstore;'; fi"
./test/reset_tests.sh
working-directory: ./

- name: Run Tests
run: vendor/bin/phpunit
working-directory: ./
2 changes: 1 addition & 1 deletion test/fixtures/bookstore/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ propel.schema.autoPrefix = true

# For MySQL or Oracle, you also need to specify username & password
propel.database.user = root
#propel.database.password = [db password]
propel.database.password = root

# Note that if you do not wish to specify the database (e.g. if you
# are using multiple databases) you can use the @DB@ token which
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/bookstore/runtime-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
For MySQL and Oracle you must specify username + password separate from DSN:
-->
<user>root</user>
<password></password>
<password>root</password>
<options>
<option id="ATTR_PERSISTENT">false</option>
</options>
Expand Down Expand Up @@ -56,7 +56,7 @@
For MySQL and Oracle you must specify username + password separate from DSN:
-->
<user>root</user>
<password></password>
<password>root</password>
<options>
<option id="ATTR_PERSISTENT">false</option>
</options>
Expand All @@ -78,7 +78,7 @@
For MySQL and Oracle you must specify username + password separate from DSN:
-->
<user>root</user>
<password></password>
<password>root</password>
<options>
<option id="ATTR_PERSISTENT">false</option>
</options>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/namespaced/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ propel.disableIdentifierQuoting=true

# For MySQL or Oracle, you also need to specify username & password
propel.database.user = root
#propel.database.password = [db password]
propel.database.password = root

# Note that if you do not wish to specify the database (e.g. if you
# are using multiple databases) you can use the @DB@ token which
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/namespaced/runtime-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
For MySQL and Oracle you must specify username + password separate from DSN:
-->
<user>root</user>
<password></password>
<password>root</password>
<options>
<option id="ATTR_PERSISTENT">false</option>
</options>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/nestedset/runtime-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<phptype>sqlite</phptype>
<dsn>sqlite:/var/tmp/nestedset.db</dsn>
<username></username>
<password></password>
<password>root</password>
</connection>
</datasource>
</datasources>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/reverse/mysql/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ propel.database.url = mysql:dbname=reverse_bookstore

# For MySQL or Oracle, you also need to specify username & password
propel.database.user = root
#propel.database.password = [db password]
propel.database.password = root

propel.mysql.tableType = InnoDB

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/reverse/mysql/runtime-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
For MySQL and Oracle you must specify username + password separate from DSN:
-->
<user>root</user>
<password></password>
<password>root</password>
<options>
<option id="ATTR_PERSISTENT">false</option>
</options>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/reverse/pgsql/runtime-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!--
For MySQL and Oracle you must specify username + password separate from DSN:
<user>bookstore</user>
<password></password>
<password>root</password>
-->
<options>
<option id="ATTR_PERSISTENT">false</option>
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/schemas/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ propel.project = bookstore
propel.database = mysql
propel.database.url = mysql:dbname=test
propel.database.user = root
propel.database.password = root
propel.mysql.tableType = InnoDB
propel.disableIdentifierQuoting = true
propel.schema.autoPrefix = true
2 changes: 1 addition & 1 deletion test/fixtures/schemas/runtime-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
For MySQL and Oracle you must specify username + password separate from DSN:
-->
<user>root</user>
<password></password>
<password>root</password>
<options>
<option id="ATTR_PERSISTENT">false</option>
</options>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/treetest/runtime-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<phptype>sqlite</phptype>
<dsn>sqlite:/var/tmp/treetest.db</dsn>
<username></username>
<password></password>
<password>root</password>
</connection>
</datasource>
</datasources>
Expand Down