Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork authored May 14, 2024
0 parents commit da25304
Show file tree
Hide file tree
Showing 20 changed files with 460 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
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,xml}]
indent_size = 2
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* text=auto

*.lock -diff
*.min.js -diff
*.min.css -diff

/.github export-ignore
CHANGELOG.md export-ignore
37 changes: 37 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: phpstan

on: [ push, pull_request ]

jobs:
analyze:
runs-on: ubuntu-latest

name: PHPStan

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

- name: 🏗 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: phpstan

- name: 🏗 Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: 🏗 Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: phpstan-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: phpstan-composer-

- name: 📦 Install dependencies
run: composer install --no-interaction --no-suggest

- name: 🧪 Analyse code
run: phpstan analyse
23 changes: 23 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pint

on: [ push, pull_request ]

jobs:
analyze:
runs-on: ubuntu-latest

name: Laravel Pint

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

- name: 🏗 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: laravel/pint

- name: 🧪 Analyse code
run: pint
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish

on:
push:
tags:
- '**'

jobs:
# @see https://stackoverflow.com/a/72959712/8179249
check-current-branch:
runs-on: ubuntu-latest

outputs:
branch: ${{ steps.check_step.outputs.branch }}

steps:
- name: 🏗 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🏗 Get current branch
id: check_step
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch="$(echo ${raw//origin\//} | tr -d '\n')"
echo "{name}=branch" >> $GITHUB_OUTPUT
echo "Branches where this tag exists : $branch."
build:
runs-on: ubuntu-latest

needs: check-current-branch

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

- name: 🏗 Get release info
id: query-release-info
uses: release-flow/keep-a-changelog-action@v3
with:
command: query
version: latest

- name: 🚀 Publish to Github releases
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.query-release-info.outputs.release-notes }}
make_latest: contains(${{ needs.check.outputs.branch }}, 'main')
# prerelease: true
# files: '*.vsix'
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: tests

on: [ push, pull_request ]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.1, 8.2, 8.3 ]
stability: [ prefer-stable ]
laravel: [ 10.*, 11.* ]
include:
- laravel: 10.*
testbench: 8.*

- laravel: 11.*
testbench: 9.*
exclude:
- php: 8.1
laravel: 11.*

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

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

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

- name: 🏗 Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: 🏗 Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-composer-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
restore-keys: dependencies-composer-laravel-${{ matrix.laravel }}-

- name: 📦 Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress --${{ matrix.stability }}
- name: 🧪 Execute tests
run: vendor/bin/phpunit -c phpunit.coverage.dist.xml

- name: 🚀 Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml
fail_ci_if_error: true
# verbose: true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/vendor/
/node_modules
composer.lock
phpunit.xml
.DS_Store
coverage
clover.xml
.phpunit.cache
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"open-southeners.vscode-php-extension-pack"
]
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Open Southeners

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
title_goes_here [![required php version](https://img.shields.io/packagist/php-v/open-southeners/packagist_package_here)](https://www.php.net/supported-versions.php) [![codecov](https://codecov.io/gh/open-southeners/packagist_package_here/branch/main/graph/badge.svg?token=codecov_badge_token)](https://codecov.io/gh/open-southeners/packagist_package_here) [![Edit on VSCode online](https://img.shields.io/badge/vscode-edit%20online-blue?logo=visualstudiocode)](https://vscode.dev/github/open-southeners/packagist_package_here)
===

and_description_here

**Search & replace:**

| Keys | Replacement |
| --------------------------------------------------------- | ------------------------------------------------------------- |
| `title_goes_here` | Fancy title from the repository (only README and stuff) |
| `and_description_here` | Short package description (only for README and composer.json) |
| `packagist_package_here` | Packagist (composer) published package name |
| `codecov_badge_token` | Codecov token for the coverage badge |
| `OpenSoutheners\PhpPackage`, `OpenSoutheners\\PhpPackage` | PSR-0 and PSR-4 complaint package namespace |

## Getting started

```
composer require open-southeners/packagist_package_here
```

## Partners

[![skore logo](https://github.com/open-southeners/partners/raw/main/logos/skore_logo.png)](https://getskore.com)

## License

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Supported Versions

We're also following the [Laravel's default support policy](https://laravel.com/docs/master/releases#support-policy) on our semantic versioning.

| Version | Supported |
| ------- | ------------------ |
| 1.x | :white_check_mark: |
<!-- | 2.x | :white_check_mark: | -->
<!-- | < 1.0 | :x: | -->

## Reporting a Vulnerability

Send us an email at [email protected]
52 changes: 52 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "open-southeners/packagist_package_here",
"description": "and_description_here",
"license": "MIT",
"keywords": [
"open-southeners"
],
"authors": [
{
"name": "Ruben Robles",
"email": "[email protected]",
"homepage": "https://d8vjork.com"
}
],
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/open-southeners"
}
],
"require": {
"php": "^8.1"
},
"require-dev": {
"larastan/larastan": "^2.0",
"orchestra/testbench": "^8.0 || ^9.0",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^10.0"
},
"minimum-stability": "stable",
"prefer-stable": true,
"autoload": {
"psr-4": {
"OpenSoutheners\\PhpPackage\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"OpenSoutheners\\PhpPackage\\Tests\\": "tests"
}
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"OpenSoutheners\\PhpPackage\\ServiceProvider"
]
}
}
}
8 changes: 8 additions & 0 deletions dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
11 changes: 11 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
includes:
- ./vendor/larastan/larastan/extension.neon

parameters:

paths:
- src

level: "max"

checkMissingIterableValueType: false
Loading

0 comments on commit da25304

Please sign in to comment.