Skip to content

Commit

Permalink
Merge branch 'main' into feature/install-elastic
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit authored Jul 23, 2024
2 parents 3c08d00 + 47d22fa commit 9ec2f39
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 21 deletions.
30 changes: 30 additions & 0 deletions .github/commit_message.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ==== Commit Messages ====

# ==== Commit Messages(Template) ====
# <type>: <subject>
# fix: Fixed a bug in the code
# hotfix: Fixed a critical bug in the code
# feat: Added new feature
# docs: Added documentation
# style: Updated code style
# refactor(clean,improve): Cleaned up code, improved code quality
# test: Added tests
# chore: Updated build tasks, package manager configs, etc
#
# ==== Emojis ====
# 🐛 :bug: Bug fix
# 👍 :+1: Functionality improvement
# ✨ :sparkles: Partial feature addition
# 🎨 :art: Design change only
# 💢 :anger: Conflict
# 🚧 :construction: WIP
# 📝 :memo: Wording correction
# ♻️ :recycle: Refactoring
# 🔥 :fire: Removal of unnecessary and unused features
# 💚 :green_heart: Test and CI corrections and improvements
# 👕 :shirt: Lint error corrections and code style corrections
# 🚀 :rocket: Performance improvement
# 🆙 :up: Update of dependent packages, etc.
# 👮 :cop: Security-related improvements
# ⚙ :gear: Config change
# 📚 :books: Documentation
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Summary
<!-- Describe why you made changes and the changes, including screenshots if necessary. What did you do with this pull request? -->

## Unit Testing
<!-- List your unit/integration tests here, or if there are no unit tests, please explain why. -->

## Operation check
<!-- URL of checklist, etc. -->

> [!CAUTION]
> ### Release Notes
> <!-- * Information if you need to manually configure something at release time -->
> <!-- * Commands to run after release, etc. -->
> *
> [!NOTE]
> ### Additional Notes
> <!-- * Reference information for reviewers (if there are any implementation concerns or points of note, please state them) -->
> *
## Checklist
* [ ] Code follows our Coding Standards.
* [ ] Code matches the confirmed solution in the ticket.
* [ ] Unit/Integration tests have been added or updated.
* [ ] Env/Config/DB changes were confirmed by @cslant/admin.
38 changes: 38 additions & 0 deletions .github/workflows/setup_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Setup & test

on: [ push, pull_request ]

jobs:
tests:
name: Composer P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
php: [ '8.1', '8.2', '8.3' ]
laravel: [ 11.*, 10.*, 9.* ]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 8.*
exclude:
- laravel: 11.*
php: 8.1
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

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

- name: Install dependencies
run: |
composer install --no-interaction --no-progress --no-suggest
- name: Run tests
run: |
composer validate --strict
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# blog-core
# blog-core

## commit template
```bash
git config --local commit.template .github/commit_message.txt
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "cslant/blog-core",
"description": "Send notification from Gitlab and Github events to Telegram",
"description": "A Laravel package for CSlant blog Core",
"keywords": [
"cslant",
"laravel",
"cslant-blog-api-package",
"cslant-blog-api",
"cslant-blog-core-package",
"cslant-blog-core",
"cslant-blog",
"cslant-api",
"cslant-core",
"cslant-package",
"blog-api-package",
"blog-core-package",
"blog-core"
],
"homepage": "https://github.com/cslant/blog-core",
Expand Down
5 changes: 1 addition & 4 deletions config/blog-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
$routePrefix = env('BLOG_API_ROUTE_PREFIX', 'api');

return [
'defaults' => [
/* Set route prefix for the blog API */
'route_prefix' => $routePrefix,
],
'defaults' => [],
];
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</include>
</coverage>
<testsuites>
<testsuite name="CSlant Blog API Package">
<testsuite name="CSlant Blog Core Package">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
11 changes: 1 addition & 10 deletions routes/blog-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/*
|--------------------------------------------------------------------------
| Blog API Routes
| Blog Core Routes
|--------------------------------------------------------------------------
|
| Here is where you can register bot routes for your application. These
Expand All @@ -13,12 +13,3 @@
|
*/

$routePrefix = config('blog-api.defaults.route_prefix');

Route::prefix($routePrefix)->name("$routePrefix.")->group(function () {
Route::get('/posts', function () {
return response()->json([
'message' => 'Hello from the blog API!',
]);
});
});
31 changes: 31 additions & 0 deletions workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PHPStan

on: [push, pull_request]

jobs:
phpstan:
runs-on: ${{ matrix.os }}
name: PHPStan - P${{ matrix.php }}

strategy:
matrix:
os: [ ubuntu-latest ]
php: [ '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: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
composer install --no-interaction --no-progress --no-suggest
- name: Run PHPStan
run: |
composer analyse --error-format=github

0 comments on commit 9ec2f39

Please sign in to comment.