Skip to content

Commit

Permalink
feat: update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Jun 13, 2023
1 parent 0946a85 commit 9726a76
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 77 deletions.
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 }}

...
11 changes: 9 additions & 2 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 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
25 changes: 24 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
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
10 changes: 5 additions & 5 deletions app/composer.lock

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

2 changes: 2 additions & 0 deletions app/database/factories/RoleFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
restart: on-failure
networks:
- default
- shared
depends_on:
- database
links:
Expand All @@ -25,8 +26,6 @@ services:
- ~/.ssh:/home/www-data/.ssh
environment:
FAKETIME: "+2h"
env_file:
- .env
dns:
8.8.8.8

Expand Down

0 comments on commit 9726a76

Please sign in to comment.