-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add support for GitHub actions #1859
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
Changes from all commits
ebd3965
ffb5698
3d04f59
bd7a019
0a6232f
8999a03
002a9ed
f22075f
b5babda
0f14787
b6d5346
ce1ea38
b99dcd2
ff07bef
291cb95
629692f
551aaf2
b0e7e0a
f08f4e9
389eb98
479a97d
5beca2b
725fc2a
847efe1
a51a266
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
tags: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [7.1, 7.2, 7.3] | ||
services: | ||
mongo: | ||
image: mongo | ||
ports: | ||
- 27017:27017 | ||
mysql: | ||
image: mysql:5.7 | ||
ports: | ||
- 3307:3306 | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' | ||
MYSQL_DATABASE: 'unittest' | ||
MYSQL_ROOT_PASSWORD: | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Show php version | ||
run: php${{ matrix.php }} -v && composer -V | ||
- name: Show docker and docker-compose versions | ||
run: | | ||
docker version | ||
- name: Debug if needed | ||
run: if [[ "$DEBUG" == "true" ]]; then env; fi | ||
env: | ||
DEBUG: ${{secrets.DEBUG}} | ||
- name: Install dependencies | ||
run: | | ||
composer install --no-interaction | ||
- name: Generating code coverage | ||
run: | | ||
mkdir -p build/logs | ||
./vendor/bin/phpunit --coverage-clover build/logs/clover.xml | ||
env: | ||
MONGO_HOST: 0.0.0.0 | ||
MYSQL_HOST: 0.0.0.0 | ||
MYSQL_PORT: 3307 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to set env vars before we run phpunit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. env variable |
||
- name: Send coveralls | ||
run: vendor/bin/php-coveralls -v | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
$mongoHost = env('MONGO_HOST', 'mongodb'); | ||
$mongoPort = env('MONGO_PORT') ? (int) env('MONGO_PORT') : 27017; | ||
$mysqlPort = env('MYSQL_PORT') ? (int) env('MYSQL_PORT') : 3306; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since we are starting the mysql service on port 3307, if for some reason the env variable isn't set will this connect? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or can to connect or connect was failed |
||
return [ | ||
|
||
|
@@ -23,6 +24,7 @@ | |
'mysql' => [ | ||
'driver' => 'mysql', | ||
'host' => env('MYSQL_HOST', 'mysql'), | ||
'port' => $mysqlPort, | ||
'database' => env('MYSQL_DATABASE', 'unittest'), | ||
'username' => env('MYSQL_USERNAME', 'root'), | ||
'password' => env('MYSQL_PASSWORD', ''), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since 7.4 is out is that something we want to look at supporting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cann add 7.4 to matrix in any time