diff --git a/.github/workflows/label.yml b/.github/workflows/apply-labels.yml similarity index 61% rename from .github/workflows/label.yml rename to .github/workflows/apply-labels.yml index 1c654a3d..c9b1196b 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/apply-labels.yml @@ -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 @@ -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 }} ... diff --git a/.github/workflows/auto-merge-release.yaml b/.github/workflows/auto-merge-release.yaml index 9f4d53ec..084a3e12 100644 --- a/.github/workflows/auto-merge-release.yaml +++ b/.github/workflows/auto-merge-release.yaml @@ -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 }} ... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1382ea5..18c9269f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/codesee-arch-diagram.yml b/.github/workflows/create-arch-diagram.yml similarity index 51% rename from .github/workflows/codesee-arch-diagram.yml rename to .github/workflows/create-arch-diagram.yml index d066e3f5..abb38a9a 100644 --- a/.github/workflows/codesee-arch-diagram.yml +++ b/.github/workflows/create-arch-diagram.yml @@ -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 @@ -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 }} + +... diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 2c068143..84588faa 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -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 @@ -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 }} ... diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index 79b70ca7..7b8ca492 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -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 @@ -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 diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index ffa82895..3aba3d1d 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -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 @@ -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 diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index bcfa96df..d23d1642 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -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 }} ... diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f87e608..7b0ea703 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: diff --git a/Makefile b/Makefile index 821190e4..7b17e66a 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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 # ------------------------------------------------------------------------------------ @@ -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: diff --git a/app/composer.lock b/app/composer.lock index 7af1ae11..37429eba 100644 --- a/app/composer.lock +++ b/app/composer.lock @@ -9686,12 +9686,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "22b763b5abdc69572b66c462cd85c2b2135f56aa" + "reference": "7d728f50cf52ce838ac1c1504190823b4dc06b4d" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/Roave/SecurityAdvisories/zipball/22b763b5abdc69572b66c462cd85c2b2135f56aa", - "reference": "22b763b5abdc69572b66c462cd85c2b2135f56aa", + "url": "https://github.com/gitapi/repos/Roave/SecurityAdvisories/zipball/7d728f50cf52ce838ac1c1504190823b4dc06b4d", + "reference": "7d728f50cf52ce838ac1c1504190823b4dc06b4d", "shasum": "" }, "conflict": { @@ -9847,7 +9847,7 @@ "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", "froala/wysiwyg-editor": "<3.2.7", - "froxlor/froxlor": "<2.0.20", + "froxlor/froxlor": "<2.1", "fuel/core": "<1.8.1", "funadmin/funadmin": "<=3.2", "gaoming13/wechat-php-sdk": "<=1.10.2", @@ -10287,7 +10287,7 @@ "type": "tidelift" } ], - "time": "2023-06-09T23:04:09+00:00" + "time": "2023-06-12T19:03:43+00:00" }, { "name": "sebastian/cli-parser", diff --git a/app/database/factories/RoleFactory.php b/app/database/factories/RoleFactory.php index a3424fec..7559650f 100644 --- a/app/database/factories/RoleFactory.php +++ b/app/database/factories/RoleFactory.php @@ -1,5 +1,7 @@