Skip to content

Commit

Permalink
Merge pull request #87 from wayofdev/develop
Browse files Browse the repository at this point in the history
chore: develop into master
  • Loading branch information
lotyp committed Jun 15, 2023
2 parents 299db4d + b44b705 commit 283ccb6
Show file tree
Hide file tree
Showing 58 changed files with 1,916 additions and 864 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LOG_LEVEL=debug

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_PORT=5432
DB_DATABASE=wod
DB_USERNAME=wod
DB_PASSWORD=password
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---

# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md

on: # yamllint disable-line rule:truthy
Expand All @@ -12,11 +14,10 @@ name: 🏷️ Add labels

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: 🏷️ Apply labels
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master
with:
os: ubuntu-latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

...
19 changes: 9 additions & 10 deletions .github/workflows/auto-merge-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ name: 🤞 Auto merge release

jobs:
auto-merge:
if: github.actor == 'lotyp' && startsWith(github.head_ref, 'release-please--')
runs-on: ubuntu-latest
steps:
- name: 🤞 Auto-merge pull request
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: merge
# to trigger other workflows, pass PAT token instead of GITHUB_TOKEN
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
uses: wayofdev/gh-actions/.github/workflows/auto-merge-release.yml@master
with:
os: ubuntu-latest
pull-request-number: ${{ github.event.pull_request.number }}
actor: lotyp
merge-method: merge
secrets:
# to trigger other workflows, pass PAT token instead of GITHUB_TOKEN
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}

...
17 changes: 11 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-22.04"]
php: ["8.1", "8.2"]
php: ["8.2"]

steps:
- name: 📦 Check out the codebase
Expand All @@ -29,7 +29,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo, xdebug
extensions: curl, mbstring, zip, fileinfo, xdebug, decimal
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: xdebug
Expand All @@ -46,6 +46,13 @@ jobs:
path: vendor
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}

- name: ♻️ Restore cached .build directory
id: cached-build-dir
uses: actions/cache@v3
with:
path: .build
key: build-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}

- name: 📥 Install backend dependencies
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
run: composer install
Expand All @@ -70,12 +77,10 @@ jobs:
run: php artisan storage:link

- name: 🔍 Run coding standards task
run: |
composer run cs:diff
run: composer run cs:diff

- name: 🔍 Run static analysis using phpstan
run: |
composer run stan
run: composer run stan
env:
PHPSTAN_OUTPUT_FORMAT: github

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---

# This workflow was added by CodeSee. Learn more at https://codesee.io/
# This is v2.0 of this workflow file

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
branches:
- develop
Expand All @@ -18,10 +19,11 @@ permissions: read-all

jobs:
codesee:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: 💻 Analyze the repo with CodeSee
uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
uses: wayofdev/gh-actions/.github/workflows/create-arch-diagram.yml@master
with:
os: ubuntu-latest
continue-on-error: true
secrets:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}

...
33 changes: 8 additions & 25 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---

# https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml
# https://github.com/google-github-actions/release-please-action#release-types-supported

on: # yamllint disable-line rule:truthy
Expand All @@ -11,30 +12,12 @@ name: 📦 Create release

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: 🎉 Create release
uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
release-type: node
package-name: docker-node
default-branch: master
changelog-types: |
[
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "chore", "section": "Miscellaneous", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": true },
{ "type": "revert", "section": "Reverts", "hidden": true },
{ "type": "deps", "section": "Dependencies", "hidden": true },
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
{ "type": "test", "section": "Tests", "hidden": true },
{ "type": "build", "section": "Build System", "hidden": true },
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
]
uses: wayofdev/gh-actions/.github/workflows/create-release.yml@master
with:
os: ubuntu-latest
branch: master
package-name: laravel-starter-tpl
secrets:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}

...
4 changes: 2 additions & 2 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-22.04"]
php: ["8.1"]
php: ["8.2"]
environment:
name: production
url: https://prod.laravel-starter-tpl.wayof.dev
Expand All @@ -29,7 +29,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo
extensions: curl, libxml, mbstring, zip, fileinfo, decimal
ini-values: error_reporting=E_ALL
tools: composer:v2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-22.04"]
php: ["8.1"]
php: ["8.2"]
environment:
name: staging
url: https://staging.laravel-starter-tpl.wayof.dev
Expand All @@ -29,7 +29,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo
extensions: curl, libxml, mbstring, zip, fileinfo, decimal
ini-values: error_reporting=E_ALL
tools: composer:v2

Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ permissions:

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 🐞 Differential shell-check
uses: redhat-plumbers-in-action/differential-shellcheck@v4
with:
severity: warning
token: ${{ secrets.GITHUB_TOKEN }}
uses: wayofdev/gh-actions/.github/workflows/shellcheck.yml@master
with:
os: ubuntu-latest
severity: warning
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

...
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: fix-encoding-pragma

- repo: https://github.com/commitizen-tools/commitizen
rev: 3.2.1
rev: 3.2.2
hooks:
- id: commitizen
stages:
Expand Down
29 changes: 26 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BUILDER_PARAMS ?= docker run --rm -i \
--env COMPOSER_AUTH="$(COMPOSER_AUTH)"

BUILDER ?= $(BUILDER_PARAMS) $(SUPPORT_IMAGE)
BUILDER_WIRED ?= $(BUILDER_PARAMS) --network $(COMPOSE_PROJECT_NAME)_default $(SUPPORT_IMAGE)
BUILDER_WIRED ?= $(BUILDER_PARAMS) --network project.$(COMPOSE_PROJECT_NAME) $(SUPPORT_IMAGE)

# Shorthand wait4x command, executed through build-deps
WAITER ?= $(BUILDER_WIRED) wait4x
Expand Down Expand Up @@ -88,7 +88,7 @@ help: ## Show this menu
# Default action
# Defines default command when `make` is executed without additional parameters
# ------------------------------------------------------------------------------------
all: hooks key prepare up
all: hooks install key prepare up
.PHONY: all


Expand Down Expand Up @@ -124,7 +124,7 @@ prepare:
# ------------------------------------------------------------------------------------
up: # Creates and starts containers, defined in docker-compose and override file
$(DOCKER_COMPOSE) up --remove-orphans -d
$(DOCKER_COMPOSE) exec app wait4x tcp database:5432 -t 1m
$(DOCKER_COMPOSE) exec app wait4x postgresql 'postgres://${DB_USERNAME}:${DB_PASSWORD}@database:5432/${DB_DATABASE}?sslmode=disable' -t 1m
.PHONY: up

down: # Stops and removes containers of this project
Expand Down Expand Up @@ -178,6 +178,10 @@ lint-stan:
$(APP_COMPOSER) run-script stan
.PHONY: lint-stan

lint-deps:
$(APP_COMPOSER) run-script deptrac
.PHONY: lint-deps

test: ## Run project php-unit and pest tests
$(APP_COMPOSER) test
.PHONY: test
Expand All @@ -186,6 +190,10 @@ test-cc: ## Run project php-unit and pest tests in coverage mode and build repor
$(APP_COMPOSER) test:cc
.PHONY: test-cc

api-docs: ## Generate openapi docs specification file
$(APP_EXEC) php artisan open-docs:generate
.PHONY: api-docs


# Composer Commands
# ------------------------------------------------------------------------------------
Expand All @@ -197,11 +205,26 @@ update: ## Update composer dependencies
$(APP_COMPOSER) update $(package)
.PHONY: update

du: ## Dump composer autoload
$(APP_COMPOSER) dump-autoload
.PHONY: du

show: ## Shows information about installed composer packages
$(APP_COMPOSER) show
.PHONY: show


# Database Commands
# ------------------------------------------------------------------------------------
db-wipe: ## Wipe database
$(APP_EXEC) php artisan db:wipe
.PHONY: db-wipe

db-refresh: ## Delete migration files, wipe database, create new migrations, run them and seed database
$(APP_EXEC) php artisan migrate:fresh
.PHONY: db-refresh


# Deployer Commands
# ------------------------------------------------------------------------------------
dep-staging:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<img width="456" src="https://raw.githubusercontent.com/wayofdev/laravel-starter-tpl/master/assets/logo.gh-light-mode-only.png#gh-light-mode-only">
<img width="456" src="https://raw.githubusercontent.com/wayofdev/laravel-starter-tpl/master/assets/logo.gh-dark-mode-only.png#gh-dark-mode-only">
</div>

<br>

<br>
Expand Down Expand Up @@ -122,8 +121,9 @@ To use this repository, you need to meet the following requirements:
```bash
$ make

# or run commands separatley
# or run commands separately
$ make hooks
$ make install
$ make key
$ make prepare
$ make up
Expand Down
4 changes: 2 additions & 2 deletions app/bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
Laravel\Http\Kernel::class
Laravel\HttpKernel::class
);

$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
Laravel\Console\Kernel::class
Laravel\ConsoleKernel::class
);

$app->singleton(
Expand Down
Loading

0 comments on commit 283ccb6

Please sign in to comment.