Skip to content

Commit

Permalink
Merge pull request #51 from Hi-Folks/develop
Browse files Browse the repository at this point in the history
v0.2.4
  • Loading branch information
roberto-butti authored Apr 18, 2021
2 parents 83f75a2 + e69c7dc commit 7a7fbec
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 63 deletions.
109 changes: 48 additions & 61 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,56 @@
# GithHub Actions Workflow generated with Ghygen
# Original configuration: https://ghygen.hi-folks.dev?code=bb85a1693f8aa341b4c92d07cea283be
# Original configuration: http://gh-actions-yaml-generator.test?code=c8d53a9318c7a2b641f80d605f104de5
name: Test Laravel Package
on:
push:
branches:
- main
- master
- develop
- features/**
- feature/**
push:
branches:
- master
- develop
- features/**

jobs:
laravel-tests:
runs-on: ubuntu-latest

strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '8.0','7.4','7.3' ]
dependency-stability: [ prefer-stable ]

name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}

steps:
- uses: actions/checkout@v2
- name: Install PHP versions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Get Composer Cache Directory 2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
id: actions-cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist




- name: Show dir
run: pwd
- name: PHP Version
run: php --version

- name: Execute tests (Unit and Feature tests) via PHPUnit
# Set environment
env:
SESSION_DRIVER: array

run: vendor/bin/phpunit --testdox

- name: Execute Code Sniffer via phpcs
run: |
vendor/bin/phpcs --standard=PSR12 src
- name: Execute Code Static Generator via phpstan
run: |
vendor/bin/phpstan analyse src -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress
laravel-tests:
runs-on: ubuntu-latest

strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '8.0','7.4','7.3' ]
dependency-stability: [ prefer-stable ]

name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}

steps:
- uses: actions/checkout@v2
- name: Install PHP versions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Install Dependencies
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist


- name: Show dir
run: pwd
- name: PHP Version
run: php --version

# Code quality
- name: Execute tests (Unit and Feature tests) via PHPUnit
# Set environment
env:
SESSION_DRIVER: array

run: vendor/bin/phpunit --testdox

- name: Execute Code Sniffer via phpcs
run: |
vendor/bin/phpcs --standard=PSR12 src
- name: Execute Code Static Analysis (PHP Stan + Larastan)
run: |
vendor/bin/phpstan analyse src -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changelog
## 0.2.4 - 2021-04-18
### Add
- In runtime information, added upload_max_filesize and post_max_size from php configuration ( thanks to @yogendra-revanna )

## 0.2.3 - 2021-04-10
### Add
- Check DEBUG and ENV configuration for production (if production avoid having debug on);
- Check Storage Links and sohw the user a waring if some directory links are missing
- Check Storage Links and show the user a waring if some directory links are missing

### Change
- improve tests and checks script for Workflows
Expand Down
15 changes: 15 additions & 0 deletions src/Lens/Traits/RuntimeLens.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ private function appCaller($results, $functions)
}
}

private function getIniValues($results)
{
$labels = [
"post_max_size",
"upload_max_filesize",
];
foreach ($labels as $label) {
$results->add(
$label,
ini_get($label)
);
}
}

public function getRuntimeConfigs()
{
$results = new ResultLens();
$results->add(
"PHP Version",
phpversion()
);
$this->getIniValues($results);
$results->add(
"Current Directory",
getcwd()
Expand Down
2 changes: 1 addition & 1 deletion tests/ConsistencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function test_runtimeconfig_array()
$l = new LaraLens();
$a = $l->getRuntimeConfigs();
$this->assertIsArray($a->toArray());
$this->assertCount(20, $a->toArray());
$this->assertCount(22, $a->toArray());
}
/** @test */
public function test_database_array()
Expand Down

0 comments on commit 7a7fbec

Please sign in to comment.