Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmejias committed Apr 8, 2023
1 parent 76664ae commit fbdd020
Show file tree
Hide file tree
Showing 13 changed files with 525 additions and 184 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
41 changes: 41 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: static analysis

on:
push:
branches:
- master
- "*.x"
pull_request:

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-22.04

strategy:
fail-fast: true

name: Static Analysis

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

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

- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress

- name: Execute type checking
run: vendor/bin/phpstan
68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
tests:
runs-on: ubuntu-22.04

strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2]
laravel: [^6.0, ^7.0, ^8.0, ^9.0, ^10.0]
exclude:
- php: 7.2
laravel: ^8.0
- php: 7.2
laravel: ^9.0
- php: 7.2
laravel: ^10.0
- php: 7.3
laravel: ^9.0
- php: 7.3
laravel: ^10.0
- php: 7.4
laravel: ^9.0
- php: 7.4
laravel: ^10.0
- php: 8.0
laravel: ^10.0
- php: 8.1
laravel: ^6.0
- php: 8.1
laravel: ^7.0
- php: 8.2
laravel: ^6.0
- php: 8.2
laravel: ^7.0

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

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

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

- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install PHP dependencies
run: |
composer require "illuminate/contracts=${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute unit tests
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.env
.env.testing
vendor/
composer.lock
phpunit.xml
.phpunit.result.cache
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"orchestra/testbench": "^6.0",
"pestphp/pest": "^1.22",
"phpunit/phpunit": "^9.5",
"pestphp/pest-plugin-laravel": "^1.4"
"pestphp/pest-plugin-laravel": "^1.4",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand All @@ -36,8 +37,6 @@
"AdrianMejias\\Pinecone\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"laravel": {
"providers": [
Expand All @@ -49,8 +48,15 @@
}
},
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
},
"branch-alias": {
"dev-master": "1.0-dev"
},
"minimum-stability": "dev",
"prefer-stable": true
}
64 changes: 63 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
paths:
- config
- src

level: 7
17 changes: 3 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<phpunit bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" convertDeprecationsToExceptions="true" processIsolation="false" stopOnFailure="false">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">tests/Feature/</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">tests/Unit/</directory>
<testsuite name="Package Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
</php>
</phpunit>
Loading

0 comments on commit fbdd020

Please sign in to comment.