Skip to content

Commit

Permalink
BREAKING CHANGE: Changes User class to Authenticatable interface, add…
Browse files Browse the repository at this point in the history
…s PHP / Laravel requirements, adds tests and ci (#4)

* adds dependencies and test folder

* adds some tests

* fix tests

* adds ci workflow

* adds pint styling workflow

* Apply automatic changes

* adds pint styling workflow

* adds .gitattributes
  • Loading branch information
zackAJ authored Feb 5, 2025
1 parent e590ea6 commit deee459
Show file tree
Hide file tree
Showing 16 changed files with 8,952 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.github export-ignore
/tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
CONTRIBUTING.md export-ignore
phpunit.xml export-ignore
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Fix Code Style

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.4]

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none

- name: Install Pint
run: composer global require laravel/pint

- name: Run Pint
run: pint

- name: Commit linted files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Pint styling

39 changes: 39 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PHP Composer

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: true

steps:
- uses: actions/checkout@v4

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/vendor
.env
/workbench
.phpunit.cache
24 changes: 22 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@
"name": "zackaj/laravel-debounce",
"description": "Debounce jobs ,notifications and artisan commands.",
"license": "MIT",
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Zackaj\\LaravelDebounce\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Zackaj\\LaravelDebounce\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"authors": [
{
"name": "zackaj",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"require": {},
"extra": {
"laravel": {
"providers": [
Expand All @@ -24,5 +31,18 @@
"Debounce": "Zackaj\\LaravelDebounce\\Facades\\Debounce"
}
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test:feature": "vendor/bin/phpunit tests/Feature",
"test:unit": "vendor/bin/phpunit tests/Unit"
},
"require-dev": {
"shipmonk/composer-dependency-analyser": "dev-master",
"orchestra/testbench": "9.x-dev"
},
"require": {
"php": "^8.1",
"laravel/framework": "^10.0|^11.0"
}
}
Loading

0 comments on commit deee459

Please sign in to comment.