Skip to content

Commit

Permalink
Merge pull request #24 from matriphe/laravel-9
Browse files Browse the repository at this point in the history
Support Laravel 9
  • Loading branch information
matriphe authored Apr 24, 2022
2 parents 271c601 + a46fdc0 commit 806f34d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 51 deletions.
52 changes: 9 additions & 43 deletions .github/workflows/larinfo.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,15 @@
name: Larinfo
on: [push, pull_request]
jobs:
ubuntu-laravel-5-6:
ubuntu-laravel-9:
name: Laravel ${{ matrix.laravel-versions }} PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']
laravel-versions: ['5.7.*', '5.8.*', '^6.20']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP with Composer
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Check PHP Version and Modules
run: php -v && php -m
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.operating-system }}-php-${{ matrix.php-versions }}-laravel-${{ matrix.laravel-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.operating-system }}-php-${{ matrix.php-versions }}-laravel-${{ matrix.laravel-versions }}-
- name: Install Laravel
run: composer require "laravel/framework:${{ matrix.laravel-versions }}" --prefer-dist --no-progress
- name: Update Composer dependencies
run: composer update --prefer-dist --no-progress --no-suggest --optimize-autoloader
- name: Run Unit Tests
run: php vendor/bin/phpunit --group unit
- name: Run Ubuntu Tests
run: php vendor/bin/phpunit --group ubuntu
ubuntu-laravel-7-8:
name: Laravel ${{ matrix.laravel-versions }} PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0']
laravel-versions: ['^7.29', '^8.12']
php-versions: ['8.0']
laravel-versions: ['^9.0']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -71,15 +37,15 @@ jobs:
run: vendor/bin/phpunit --group ubuntu
- name: Run Larinfo Command
run: php vendor/bin/testbench larinfo
macos-laravel-7-8:
macos-laravel-9:
name: Laravel ${{ matrix.laravel-versions }} PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [macos-10.15]
php-versions: ['8.0']
laravel-versions: ['^7.29', '^8.12']
laravel-versions: ['^9.0']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -107,15 +73,15 @@ jobs:
run: vendor/bin/phpunit --group macos
- name: Run Larinfo Command
run: php vendor/bin/testbench larinfo
windows-laravel-7-8:
windows-laravel-9:
name: Laravel ${{ matrix.laravel-versions }} PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }} without com_dotnet
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [windows-2019]
php-versions: ['8.0']
laravel-versions: ['^7.29', '^8.12']
laravel-versions: ['^9.0']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -144,15 +110,15 @@ jobs:
run: vendor/bin/phpunit --group windows
- name: Run Larinfo Command
run: php vendor/bin/testbench larinfo
windows-with-com-dotnet-laravel-7-8:
windows-with-com-dotnet-laravel-9:
name: Laravel ${{ matrix.laravel-versions }} PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }} with com_dotnet
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [windows-2019]
php-versions: ['8.0']
laravel-versions: ['^7.29', '^8.12']
laravel-versions: ['^9.0']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ It wraps [Linfo](https://github.com/jrgp/linfo) to show IP address information o

## Requirements

- **PHP version**: `^7.4` and `^8.0`.
- **Laravel version**: `5.7.*`, `5.8.*`, `^6.0`, `^7.0`, and `^8.0`.
- **PHP version**: `^8.0.2`.
- **Laravel version**: `^9.0`.

### For Windows User

Expand All @@ -31,7 +31,8 @@ composer require matriphe/larinfo
```
### Older Version

For older version, **[please check version 2.x](https://github.com/matriphe/larinfo/tree/2.2)** which supports Laravel `5.0`, `5.1`, `5.2`, `5.3`, `5.4`, `5.5`, and `5.6`.
- Laravel `5.0`, `5.1`, `5.2`, `5.3`, `5.4`, `5.5`, and `5.6`, **[please use version 2.2](https://github.com/matriphe/larinfo/releases/tag/2.2)** by running `composer require matriphe/larinfo:2.2`.
- Laravel `5.7.*`, `5.8.*`, `^6.0`, `^7.0`, and `^8.0`, **[please use version 3.0.0](https://github.com/matriphe/larinfo/releases/tag/3.0.0)** by running `composer require matriphe/larinfo:3.0.0`.

### Configuration

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"sysinfo"
],
"require": {
"php": "^7.4|^8.0",
"php": "^8.0.2",
"ext-pdo": "*",
"davidepastore/ipinfo": "^0.6",
"laravel/framework": "5.7.*|5.8.*|^6.0|^7.0|^8.0",
"laravel/framework": "^9.0",
"linfo/linfo": "^4.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^3.7|^4.0|^5.0|^6.0",
"phpunit/phpunit": "^7.0|^8.5|^9.5"
"orchestra/testbench": "^7.0",
"phpunit/phpunit": "^9.5"
},
"license": "GPL-3.0",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/HardwareInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getCpu(): array
$results[] = [
self::CPU_MODEL => $model,
self::CPU_VENDOR => $cpu['Vendor'] ?? null,
self::CPU_CLOCK_MHZ => $cpu['MHz'],
self::CPU_CLOCK_MHZ => $cpu['MHz'] ?? '',
self::CPU_USAGE_PERCENTAGE => $cpu['usage_percentage'] ?? null,
];
}
Expand Down

0 comments on commit 806f34d

Please sign in to comment.