Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Aug 25, 2020
2 parents 9610a3b + 17e35c1 commit 0ec53f5
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 64 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/formats.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Static Analysis

on: ['push', 'pull_request']

jobs:
cs:
runs-on: ubuntu-latest

name: Code Style

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
coverage: none

- name: Install Dependencies
run: composer update --no-interaction --no-progress

- name: Run Rector
run: vendor/bin/rector process src --dry-run

- name: Run PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix -v --allow-risky=yes --dry-run

phpstan:
runs-on: ubuntu-latest
strategy:
matrix:
dependency-version: [prefer-lowest, prefer-stable]

name: PHPStan ${{ matrix.dependency-version }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
coverage: none

- name: Install Dependencies
run: composer update --prefer-stable --no-interaction --no-progress

- name: Run PHPStan
run: vendor/bin/phpstan analyse --no-progress
32 changes: 17 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,36 @@ jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
php: [7.3, 7.4]
php: ['7.3', '7.4', '8.0']
dependency-version: [prefer-lowest, prefer-stable]

name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}

steps:

- name: Checkout
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, mbstring, zip
tools: composer:v2
coverage: none

- name: Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist
- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install PHP 7 dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress
if: "matrix.php < 8"

- name: Install PHP 8 dependencies
run: composer update --${{ matrix.dependency-version }} --ignore-platform-req=php --no-interaction --no-progress
if: "matrix.php >= 8"

- name: Tests
run: php ./vendor/bin/pest
- name: Unit Tests
run: ./vendor/bin/pest --colors=always
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
],
"license": "MIT",
"require": {
"php": "^7.3",
"laravel/framework": "^7.0|^8.0",
"php": "^7.3 || ^8.0",
"laravel/framework": "^7.0 || ^8.0",
"pestphp/pest": "^0.3"
},
"autoload": {
Expand All @@ -30,7 +30,7 @@
}
},
"require-dev": {
"orchestra/testbench": "^5.2|^6.0",
"orchestra/testbench": "^5.2 || ^6.0",
"pestphp/pest-dev-tools": "dev-master"
},
"minimum-stability": "dev",
Expand Down

0 comments on commit 0ec53f5

Please sign in to comment.