Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 tests #1

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Analyse

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
phpstan:
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-8.3-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer install --no-interaction --no-progress
composer dump

- name: Run analyse phpstan
run: vendor/bin/phpstan analyse --error-format github
21 changes: 16 additions & 5 deletions .github/workflows/fix_style.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
name: Fix Styles
name: Style fix

on:
push:
branches: [master]

jobs:
style:
style-fix:
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-8.3-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer install
composer install --no-interaction --no-progress
composer dump

- name: Fix styles
Expand Down
53 changes: 31 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tests
name: Tests

on:
push:
Expand All @@ -8,30 +8,39 @@ on:

jobs:
phpunit:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.3, 8.2, 8.1, 8.0]

name: PHP${{ matrix.php }}
php: [8.0, 8.1, 8.2, 8.3]

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: |
composer install
composer dump

- name: Run test phpunit
run: composer test
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Validate composer.json
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer install --no-interaction --no-progress
composer dump

- name: Run test phpunit
run: vendor/bin/phpunit --stop-on-error --stop-on-failure
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "descom/dev",
"description": "Package to PHP Developer projects in Descom.es",
"type": "library",
"keywords": ["dev"],
"keywords": [
"dev"
],
"require": {
"php": "^8.0"
},
Expand All @@ -24,7 +26,8 @@
"prefer-stable": true,
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.35",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^9.5|^10.0|^10.5",
"phpstan/phpstan": "^1.8"
},
"autoload": {
"psr-4": {
Expand All @@ -38,4 +41,4 @@
"suggest": {
"friendsofphp/php-cs-fixer": "Required to apply styles"
}
}
}