Ditch Travis in favor of GitHub Actions
MODIFY
.editorconfig
.editorconfig
@@ -4,3 +4,6 @@ end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
+
+[*.yml]
+indent_size = 2

RENAME
.env.travis
.env.ci
@@ -10,7 +10,7 @@ DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=budget
DB_USERNAME=root
-DB_PASSWORD=
+DB_PASSWORD=helloworld123
BROADCAST_DRIVER=log
CACHE_DRIVER=file

ADD
.github/workflows/tests.yml
+name: Tests
+
+on: [push]
+
+jobs:
+ phpcs:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: '7.3'
+ - name: Install Composer dependencies
+ run: composer install --no-interaction
+ - name: Run PHPCS
+ run: vendor/bin/phpcs
+ phpunit:
+ runs-on: ubuntu-latest
+ services:
+ mysql:
+ image: mysql:5.7
+ env:
+ MYSQL_DATABASE: budget_testing
+ MYSQL_ROOT_PASSWORD: helloworld123
+ ports:
+ - 3306:3306
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: '7.3'
+ - name: Set up .env
+ run: php -r "file_exists('.env') || copy('.env.ci', '.env');"
+ - name: Install Composer dependencies
+ run: composer install --no-interaction
+ - name: Generate key
+ run: php artisan key:generate
+ - name: Prepare database
+ run: php artisan migrate --database=testing
+ - name: Run PHPUnit
+ run: vendor/bin/phpunit --coverage-clover=coverage.xml
+ - name: Upload coverage
+ run: bash <(curl -s https://codecov.io/bash)
+ dusk:
+ runs-on: ubuntu-latest
+ services:
+ mysql:
+ image: mysql:5.7
+ env:
+ MYSQL_DATABASE: budget_testing
+ MYSQL_ROOT_PASSWORD: helloworld123
+ ports:
+ - 3306:3306
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: '7.3'
+ - name: Set up .env
+ run: php -r "file_exists('.env') || copy('.env.ci', '.env');"
+ - name: Install Composer dependencies
+ run: composer install --no-interaction
+ - name: Generate key
+ run: php artisan key:generate
+ - name: Prepare database
+ run: php artisan migrate --database=testing
+ - name: Run Dusk
+ run: |
+ php artisan dusk:chrome-driver 89
+ nohup bash -c './vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 &'
+ nohup bash -c 'php artisan serve > /dev/null 2>&1 &'
+ php artisan dusk

DELETE
.travis.yml
-language: php
-
-php:
- - 7.3
-
-services:
- - mysql
-
-addons:
- chrome: stable
-
-before_script:
- - phpenv config-rm xdebug.ini
- - pecl install pcov
- - mysql -e 'create database budget_testing;'
- - cp .env.travis .env
- - composer install --no-interaction
- - php artisan key:generate
- - php artisan migrate --database=testing
- - php artisan dusk:chrome-driver
-
-jobs:
- include:
- - stage: test
- name: "PHPUnit"
- script: vendor/bin/phpunit --coverage-clover=coverage.xml
- after_success: bash <(curl -s https://codecov.io/bash)
- - stage: test
- name: "Dusk"
- script: google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & php artisan serve & php artisan dusk
- - stage: test
- name: "PHPCS"
- script: vendor/bin/phpcs

Ditch Travis in favor of GitHub Actions