Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update actions #4

Merged
merged 2 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}

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

steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v3
Expand All @@ -27,7 +26,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo
extensions: curl, mbstring, zip, fileinfo
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
Expand All @@ -37,19 +36,27 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

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

- name: 📥 Install dependencies
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
run: composer install

- name: 🛠️ Prepare environment
run: |
mkdir -p ./.build/php-cs-fixer
mkdir -p ./.build/phpstan
mkdir -p ./.build/phpunit

- name: 🚨 Run coding standards task
run: make cs-diff
env:
PHP_CS_FIXER_IGNORE_ENV: true

- name: 🧪 Execute phpunit and pest tests
run: make test
Expand All @@ -59,4 +66,11 @@ jobs:
env:
PHPSTAN_OUTPUT_FORMAT: github

- name: 📤 Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
verbose: true

...
29 changes: 29 additions & 0 deletions .github/workflows/create-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---

# 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
push:
branches:
- develop
pull_request_target:
types:
- opened
- synchronize
- reopened

name: 🤖 CodeSee

permissions: read-all

jobs:
codesee:
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 }}

...
36 changes: 10 additions & 26 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
---

# 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
push:
branches:
- master

name: release-please
name: 📦 Create release

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
release-type: node
package-name: laravel-package-tpl
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 }
]
release:
uses: wayofdev/gh-actions/.github/workflows/create-release.yml@master
with:
os: ubuntu-latest
branch: master
package-name: laravel-cycle-event-sourcing
secrets:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}

...
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ test-cc: ## Run project php-unit and pest tests in coverage mode and build repor

# Yaml Actions
# ------------------------------------------------------------------------------------
lint: ## Lints yaml files inside project
lint-yaml: ## Lints yaml files inside project
yamllint .
.PHONY: lint

Expand Down
Loading