update workflows with pint and recent spatie updates

This commit is contained in:
awcodes
2022-09-01 16:49:42 -04:00
parent 489a40bbcd
commit 55dc3118e4
7 changed files with 37 additions and 43 deletions

View File

@@ -10,23 +10,23 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

View File

@@ -0,0 +1,21 @@
name: Fix PHP code style issues
on: [push]
jobs:
php-code-styling:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@1.0.0
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling

View File

@@ -11,16 +11,16 @@ jobs:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
coverage: none
- name: Install composer dependencies
uses: ramsey/composer-install@v1
- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
run: ./vendor/bin/phpstan --error-format=github

View File

@@ -1,27 +0,0 @@
name: pint
on: push
jobs:
pint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Node
uses: actions/setup-node@v2
- name: Install dependencies
run: |
composer install --no-interaction
npm ci
- name: Run Pint
run: composer pint
- name: Run Prettier
run: npm run prettier
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: >
chore: fix code style

View File

@@ -13,18 +13,18 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0, 8.1]
php: [8.1]
laravel: [9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: ^7.0
testbench: 7.*
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
@@ -44,4 +44,4 @@ jobs:
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
run: vendor/bin/pest

View File

@@ -10,7 +10,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: main
@@ -25,4 +25,4 @@ jobs:
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
file_pattern: CHANGELOG.md

View File

@@ -48,9 +48,9 @@
}
},
"scripts": {
"pint": "pint",
"test:pest": "pest --parallel",
"test:phpstan": "phpstan analyse",
"pint": "vendor/bin/pint",
"test:pest": "vendor/bin/pest --parallel",
"test:phpstan": "vendor/bin/phpstan analyse",
"test": [
"@test:pest",
"@test:phpstan"