Skip to content

Commit

Permalink
Merge pull request #20 from melihovv/laravel-7-support
Browse files Browse the repository at this point in the history
laravel 7 support
  • Loading branch information
melihovv authored Mar 7, 2020
2 parents 0ba2980 + 4bb0866 commit fadabac
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 101 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run tests

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

jobs:
php-tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
php: [7.4, 7.3, 7.2]
laravel: [7.*, 6.*]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest, windows-latest]
include:
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

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

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

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
3 changes: 0 additions & 3 deletions .sensiolabs.yml

This file was deleted.

42 changes: 0 additions & 42 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 @@
Laravel package generator
=========================

[![Build Status](https://travis-ci.org/melihovv/laravel-package-generator.svg?branch=master)](https://travis-ci.org/melihovv/laravel-package-generator)
[![GitHub Workflow Status](https://github.com/melihovv/laravel-package-generator/workflows/Run%20tests/badge.svg)](https://github.com/melihovv/laravel-package-generator/actions)
[![styleci](https://styleci.io/repos/96041272/shield)](https://styleci.io/repos/96041272)

[![Packagist](https://img.shields.io/packagist/v/melihovv/laravel-package-generator.svg)](https://packagist.org/packages/melihovv/laravel-package-generator)
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions skeleton/.coveralls.yml

This file was deleted.

43 changes: 43 additions & 0 deletions skeleton/.github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Run tests

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

jobs:
php-tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
php: [7.4, 7.3, 7.2]
laravel: [7.*, 6.*]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest, windows-latest]
include:
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

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

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

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: ./vendor/bin/phpunit
42 changes: 0 additions & 42 deletions skeleton/.travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions skeleton/README.md.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# <?php echo "$packageHumanName\n"; ?>

[![Build Status](https://travis-ci.org/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>.svg?branch=master)](https://travis-ci.org/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>)
[![GitHub Workflow Status](https://github.com/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>/workflows/Run%20tests/badge.svg)](https://github.com/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>/actions)
[![styleci](https://styleci.io/repos/CHANGEME/shield)](https://styleci.io/repos/CHANGEME)
[![Coverage Status](https://coveralls.io/repos/github/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>/badge.svg?branch=master)](https://coveralls.io/github/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>?branch=master)

[![Packagist](https://img.shields.io/packagist/v/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>.svg)](https://packagist.org/packages/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>)
[![Packagist](https://poser.pugx.org/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>/d/total.svg)](https://packagist.org/packages/<?php echo $vendorFolderName; ?>/<?php echo $packageFolderName; ?>)
Expand All @@ -17,10 +16,10 @@ Install via composer
composer require <?php echo $vendorFolderName; ?>/<?php echo "$packageFolderName\n"; ?>
```

### Publish Configuration File
### Publish package assets

```bash
php artisan vendor:publish --provider="<?php echo $vendor; ?>\<?php echo $package; ?>\ServiceProvider" --tag="config"
php artisan vendor:publish --provider="<?php echo $vendor; ?>\<?php echo $package; ?>\ServiceProvider"
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions skeleton/composer.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"illuminate/support": "^6.0|^7.0"
},
"require-dev": {
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "^8.0"
"orchestra/testbench": "^4.0|^5.0",
"phpunit/phpunit": "^8.4|^9.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Traits/CopiesSkeleton.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected function getVariables(
*/
protected function getPathFromConfig($configName, $default)
{
$path = config("laravel-package-generator.$configName");
$path = config("package-generator.$configName");

if (empty($path)) {
$path = $default;
Expand Down
6 changes: 3 additions & 3 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
const CONFIG_PATH = __DIR__.'/../config/laravel-package-generator.php';
const CONFIG_PATH = __DIR__.'/../config/package-generator.php';

public function boot()
{
$this->publishes([
self::CONFIG_PATH => config_path('laravel-package-generator.php'),
self::CONFIG_PATH => config_path('package-generator.php'),
], 'config');

if ($this->app->runningInConsole()) {
Expand All @@ -27,7 +27,7 @@ public function register()
{
$this->mergeConfigFrom(
self::CONFIG_PATH,
'laravel-package-generator'
'package-generator'
);
}
}

0 comments on commit fadabac

Please sign in to comment.