Skip to content

Commit

Permalink
Merge pull request #394 from awcodes/chore/setup-testing
Browse files Browse the repository at this point in the history
Chore: setup testing and remove stray ds_store
  • Loading branch information
awcodes authored Dec 22, 2023
2 parents 4968c1b + c1a36d1 commit 171c00f
Show file tree
Hide file tree
Showing 15 changed files with 7,938 additions and 4,781 deletions.
Binary file removed .github/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -24,4 +23,4 @@ jobs:
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Chore: Fix PHP code styling"
commit_message: "Chore: Fix PHP code styling"
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Tests"

on:
push:
pull_request:

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.2, 8.1]
laravel: [10.*]
dependency-version: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

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

- name: "Cache dependencies"
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pdo, pdo_sqlite
coverage: none

- name: "Install dependencies"
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "filament/filament" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: "Execute tests"
run: ./vendor/bin/pest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DS_Store
**/.DS_Store
.idea
.phpunit.result.cache
.vscode
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"awcodes/filament-tiptap-editor": "^3.0",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.0",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.19",
"pestphp/pest-plugin-laravel": "^2.2",
"pestphp/pest-plugin-livewire": "^2.1",
"spatie/laravel-ray": "^1.26"
},
"autoload": {
Expand All @@ -35,11 +39,14 @@
],
"psr-4": {
"Awcodes\\Curator\\": "src",
"Awcodes\\Curator\\Database\\Factories\\": "database/factories"
"Awcodes\\Curator\\Tests\\": "tests/src",
"Awcodes\\Curator\\Database\\Factories\\": "database/factories",
"Awcodes\\Curator\\Tests\\Database\\Factories\\": "tests/database/factories"
}
},
"scripts": {
"pint": "vendor/bin/pint"
"pint": "vendor/bin/pint",
"test": "vendor/bin/pest"
},
"config": {
"sort-packages": true,
Expand Down
Loading

0 comments on commit 171c00f

Please sign in to comment.