Skip to content

Commit 543692c

Browse files
authored
Chore/laravel 8 support (#28)
* 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.
1 parent bc986c2 commit 543692c

File tree

5 files changed

+56
-39
lines changed

5 files changed

+56
-39
lines changed

.github/workflows/tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-20.04
9+
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
php: [7.3, 7.4]
14+
stability: [prefer-lowest, prefer-stable]
15+
16+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
- name: Cache dependencies
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.composer/cache/files
25+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
26+
- name: Download Percona Repo
27+
run: wget --quiet https://repo.percona.com/apt/percona-release_latest.generic_all.deb
28+
- name: Install Percona Repo
29+
run: sudo dpkg -i percona-release_latest.generic_all.deb
30+
- name: Install Percona Toolkit
31+
run: sudo apt-get install -y -qq percona-toolkit
32+
- name: Workaround outdated PTOSC validation
33+
run: sudo sed -i -r -e 's/^([ \t]*if \()(\$vp->cmp\()/\1 0 \&\& \2/g' /usr/bin/pt-online-schema-change
34+
- name: Start Mysql
35+
run: sudo systemctl start mysql
36+
- name: Create Mysql DB
37+
run: mysql --user=root --password=root --host=127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS online_migrator_ci;'
38+
- name: Workaround PHP 7.3 not supporting newer authentication
39+
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;"
40+
- name: Setup PHP
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.php }}
44+
extensions: pdo, pdo_mysql
45+
coverage: none
46+
- name: Composer update
47+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
48+
- name: Execute tests
49+
run: vendor/bin/phpunit --testdox --configuration phpunit.xml.github

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
135135
## Security
136136

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

140140
## Credits
141141

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
},
1717
{
1818
"name": "ORIS Intelligence",
19-
"email": "info@orisintel.com",
19+
"email": "opensource@pricespider.com",
2020
"homepage": "https://orisintel.com",
2121
"role": "Organization"
2222
}
2323
],
2424
"require": {
25-
"php": "^7.2.5",
26-
"laravel/framework": "^7.0"
25+
"php": "^7.3",
26+
"laravel/framework": "^8.0"
2727
},
2828
"require-dev": {
2929
"doctrine/dbal": "^2.8",
3030
"larapack/dd": "^1.0",
3131
"mockery/mockery": "~1.0",
32-
"orchestra/testbench": "^5.0",
32+
"orchestra/testbench": "^6.0",
3333
"phpunit/phpunit": "^8.0|^9.0"
3434
},
3535
"autoload": {

phpunit.xml.travis renamed to phpunit.xml.github

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
<log type="coverage-text" target="build/coverage.txt"/>
2727
<log type="coverage-clover" target="build/logs/clover.xml"/>
2828
</logging>
29-
3029
<php>
30+
<env name="DB_CONNECTION" value="mysql"/>
3131
<env name="DB_DATABASE" value="online_migrator_ci"/>
32+
<env name="DB_PASSWORD" value="root"/>
3233
<env name="DB_USERNAME" value="root"/>
3334
</php>
3435
</phpunit>

0 commit comments

Comments
 (0)