Skip to content

Commit

Permalink
Switch to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Feb 24, 2020
1 parent 1698459 commit 8a34c68
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 69 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.gitattributes export-ignore
.gitignore export-ignore
.styleci.yml export-ignore
.travis.yml export-ignore
CHANGELOG-* export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests:

runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: forge
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:5.0
ports:
- 6379:6379
options: --entrypoint redis-server
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
stability: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - S${{ matrix.stability }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
coverage: none

- name: Setup Memcached
uses: niden/actions-memcached@v7

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest

- name: Start MySQL
run: sudo /etc/init.d/mysql start

- name: Execute tests
run: vendor/bin/phpunit --verbose
env:
CI: ${{ secrets.CI }}
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
41 changes: 0 additions & 41 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
@@ -1,7 +1,7 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://res.cloudinary.com/dtfbvvkyp/image/upload/v1566331377/laravel-logolockup-cmyk-red.svg" width="400"></a></p>

<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,16 @@

namespace Illuminate\Tests\Integration\Database;

use PDO;

class DatabaseEmulatePreparesMySqlConnectionTest extends DatabaseMySqlConnectionTest
{
protected function getEnvironmentSetUp($app)
{
$app['config']->set('app.debug', 'true');

// Database configuration
$app['config']->set('database.default', 'testbench');

$app['config']->set('database.connections.testbench', [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'username' => 'root',
'password' => '',
'database' => 'forge',
'prefix' => '',
'options' => [
\PDO::ATTR_EMULATE_PREPARES => true,
],
$app['config']->set('database.default', 'mysql');
$app['config']->set('database.connections.mysql.options', [
PDO::ATTR_EMULATE_PREPARES => true,
]);
}
}
13 changes: 1 addition & 12 deletions tests/Integration/Database/DatabaseMySqlConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,7 @@ class DatabaseMySqlConnectionTest extends TestCase
protected function getEnvironmentSetUp($app)
{
$app['config']->set('app.debug', 'true');

// Database configuration
$app['config']->set('database.default', 'testbench');

$app['config']->set('database.connections.testbench', [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'username' => 'root',
'password' => '',
'database' => 'forge',
'prefix' => '',
]);
$app['config']->set('database.default', 'mysql');
}

protected function setUp(): void
Expand Down

0 comments on commit 8a34c68

Please sign in to comment.