Skip to content

Commit

Permalink
Use Reusable Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanzweifel committed Dec 28, 2023
1 parent f9d079c commit 9469989
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 61 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
name: Check & fix styling
name: php-cs-fixer

on: [push]
on:
pull_request:
push:
branches:
- main

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
uses: stefanzweifel/reusable-workflows/.github/workflows/php-cs-fixer.yml@main
21 changes: 4 additions & 17 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@ on:
- 'phpstan.neon.dist'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
update_release_draft:
uses: stefanzweifel/reusable-workflows/.github/workflows/phpstan.yml@main
with:
php_version: '8.3'
6 changes: 1 addition & 5 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ on:

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: stefanzweifel/reusable-workflows/.github/workflows/release-drafter.yml@main
21 changes: 1 addition & 20 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,4 @@ on:

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
uses: stefanzweifel/reusable-workflows/.github/workflows/update-changelog.yml@main

0 comments on commit 9469989

Please sign in to comment.