Skip to content

Commit

Permalink
Chore/laravel 8 support (#28)
Browse files Browse the repository at this point in the history
* chore(composer.json): Support Laravel 8.

* chore(composer.json): Update email for organization.

* chore(CI): Move from Travis to GitHub Actions.

* fix(.github): Move to workflows.

* fix(tests.yml): Correct symbol for template.

* fix(composer.json): Bump testbench to 6 for Laravel 8.

* fix(tests.yml): Correct missing Mysql config.

* fix(tests.yml): Add host for Mysql conn.

* fix(tests.yml): Start Mysql.

* fix(tests.yml): Install Percona.

* fix(tests.yml): Install latest Percona.

* fix(tests.yml): Correct Percona install.

* fix(tests.yml): Workaround outdated PTOSC validation of Mysql 8 versions since 8.0.18+ does not have those problems.

* fix(tests.yml): Correct missing escape for slash escaping '$'.

* fix(tests.yml): Correct workaround regression and failure to escape '&'.

* fix(tests.yml): Add extensions.

* fix(tests.yml): Workaround PHP 7.3 not supporting newer Mysql authentication.

* Updated security email address in README.md.

* Correct typo in security email address.
  • Loading branch information
paulrrogers authored Nov 25, 2020
1 parent bc986c2 commit 543692c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 39 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: tests

on:
push:

jobs:
tests:
runs-on: ubuntu-20.04

strategy:
fail-fast: true
matrix:
php: [7.3, 7.4]
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Download Percona Repo
run: wget --quiet https://repo.percona.com/apt/percona-release_latest.generic_all.deb
- name: Install Percona Repo
run: sudo dpkg -i percona-release_latest.generic_all.deb
- name: Install Percona Toolkit
run: sudo apt-get install -y -qq percona-toolkit
- name: Workaround outdated PTOSC validation
run: sudo sed -i -r -e 's/^([ \t]*if \()(\$vp->cmp\()/\1 0 \&\& \2/g' /usr/bin/pt-online-schema-change
- name: Start Mysql
run: sudo systemctl start mysql
- name: Create Mysql DB
run: mysql --user=root --password=root --host=127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS online_migrator_ci;'
- name: Workaround PHP 7.3 not supporting newer authentication
run: mysql --user=root --password=root --host=127.0.0.1 -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; FLUSH PRIVILEGES;"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo, pdo_mysql
coverage: none
- name: Composer update
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --testdox --configuration phpunit.xml.github
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security

If you discover any security related issues, please email
opensource@orisintel.com instead of using the issue tracker.
opensource@pricespider.com instead of using the issue tracker.

## Credits

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
},
{
"name": "ORIS Intelligence",
"email": "info@orisintel.com",
"email": "opensource@pricespider.com",
"homepage": "https://orisintel.com",
"role": "Organization"
}
],
"require": {
"php": "^7.2.5",
"laravel/framework": "^7.0"
"php": "^7.3",
"laravel/framework": "^8.0"
},
"require-dev": {
"doctrine/dbal": "^2.8",
"larapack/dd": "^1.0",
"mockery/mockery": "~1.0",
"orchestra/testbench": "^5.0",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^8.0|^9.0"
},
"autoload": {
Expand Down
3 changes: 2 additions & 1 deletion phpunit.xml.travis → phpunit.xml.github
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>

<php>
<env name="DB_CONNECTION" value="mysql"/>
<env name="DB_DATABASE" value="online_migrator_ci"/>
<env name="DB_PASSWORD" value="root"/>
<env name="DB_USERNAME" value="root"/>
</php>
</phpunit>

0 comments on commit 543692c

Please sign in to comment.