-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from yardinternet/feat/add-more-workflows
Feat/add more workflows
- Loading branch information
Showing
9 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Composer Diff | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
composer-diff: | ||
name: Composer Diff | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Required to make it possible to compare with PR base branch | ||
|
||
- name: Generate composer diff | ||
id: composer_diff # To reference the output in comment | ||
uses: IonBazan/composer-diff-action@v1 | ||
|
||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
# An empty diff result will break this action. | ||
if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }} | ||
with: | ||
header: composer-diff # Creates a collapsed comment with the report | ||
message: | | ||
<details> | ||
<summary>Composer package changes</summary> | ||
${{ steps.composer_diff.outputs.composer_diff }} | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
name: Dependabot automerge | ||
|
||
on: | ||
- workflow_call | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: PHP CS Fixer | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
php-cs-fixer: | ||
name: php-cs-fixer | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
tools: composer:v2 | ||
coverage: none | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.YARD_BOT_PAT }} | ||
|
||
- name: Install composer dependencies | ||
run: composer install --prefer-dist --no-interaction | ||
|
||
- name: Run PHPStan | ||
run: ./vendor/bin/php-cs-fixer fix | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: '(auto): apply php-cs-fixer changes' | ||
push_options: '--force' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.YARD_BOT_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: linting | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
lint: | ||
name: Markdown Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: DavidAnson/markdownlint-cli2-action@v17 | ||
with: | ||
globs: | | ||
*.md | ||
config: .markdownlint.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: NPM Lockfile Changes | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
lockfile_changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Required to make it possible to compare with PR base branch | ||
- name: NPM Lockfile Changes | ||
uses: rvanvelzen/npm-lockfile-changes@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: PHPStan | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
phpstan: | ||
name: phpstan | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
tools: composer:v2 | ||
coverage: none | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.YARD_BOT_PAT }} | ||
|
||
- name: Install composer dependencies | ||
run: composer install --prefer-dist --no-interaction | ||
|
||
- name: Dirty fix for previously defined function (packages using php-stubs) | ||
run: [ -f ./vendor/php-stubs/wordpress-stubs/wordpress-stubs.php ] && sed -i -e 's#function __(#function ____(#' ./vendor/php-stubs/wordpress-stubs/wordpress-stubs.php | ||
|
||
- name: Run PHPStan | ||
run: ./vendor/bin/phpstan --error-format=github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
MD010: { "spaces_per_tab": 4 } | ||
MD013: false | ||
MD024: { "siblings_only": true } | ||
MD025: false | ||
MD033: false | ||
MD036: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Workflows | ||
|
||
Github Actions used in projects of the WordPress team. | ||
|
||
- PHPStan | ||
- Dependabot (auto-merge) | ||
- |