Skip to content

Commit

Permalink
Merge branch 'main' into feature/e2e-tests-workflow-wp-now
Browse files Browse the repository at this point in the history
  • Loading branch information
carstingaxion authored Oct 7, 2024
2 parents f8d255c + fd44c01 commit 5a4b97f
Show file tree
Hide file tree
Showing 110 changed files with 826 additions and 357 deletions.
3 changes: 3 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ package-lock.json
phpcs.xml
phpcs.xml.dist
phpcs.ruleset.xml
phpstan.neon
phpstan.neon.dist
phpstan.stubs
phpunit.xml
phpunit.xml.dist
playwright.config.js
Expand Down
70 changes: 0 additions & 70 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/ISSUE_TEMPLATE/2-enhancement.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/3-help.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

35 changes: 28 additions & 7 deletions .github/workflows/compress-images.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Image Actions will run in the following scenarios:
# - on Pull Requests containing images (not including forks)
# - on demand (https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/)
# For Pull Requests, the images are added to the PR.
# For other scenarios, a new PR will be opened if any images are compressed.
name: Compress Images
on:
push:
branches:
- 'fix/wp-org-screenshots-**'
workflow_dispatch:
pull_request:
# Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed.
# See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference.
Expand All @@ -12,9 +15,12 @@ on:
- '**.png'
- '**.webp'
jobs:
build:
# Only run on Pull Requests within the same repository, and not from forks.
#if: github.event.pull_request.head.repo.full_name == github.repository
compress-images:
# Only run on main repo on and PRs that match the main repo.
if: |
github.repository == 'GatherPress/gatherpress' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
name: calibreapp/image-actions
permissions: write-all
runs-on: ubuntu-latest
Expand All @@ -24,11 +30,26 @@ jobs:
uses: actions/checkout@v4

- name: Compress Images
id: compress-images
uses: calibreapp/image-actions@main #main is regularly updated (until 09/2024 so far), while the latest tagged version is from 2020
with:
# Configuration could be added
# https://github.com/marketplace/actions/image-actions#%EF%B8%8F-configuration
#
# The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories.
# See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions
githubToken: ${{ secrets.GITHUB_TOKEN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
# For non-Pull Requests, run in compressOnly mode and we'll PR after.
compressOnly: ${{ github.event_name != 'pull_request' }}

- name: Create Pull Request
# If it's not a Pull Request then commit any changes as a new PR.
if: |
github.event_name != 'pull_request' &&
steps.compress-images.outputs.markdown != ''
uses: peter-evans/create-pull-request@v4
with:
title: Auto Compress Images
branch-suffix: timestamp
commit-message: Compress Images
body: ${{ steps.compress-images.outputs.markdown }}
44 changes: 44 additions & 0 deletions .github/workflows/phpstan-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PHPStan Tests
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/phpstan-tests.yml'
- 'includes/**'
# - 'test/unit/php**'
# - '*.php'
- 'phpstan.neon.dist'
- 'composer.*'
jobs:
test-phpstan:
name: PHPStan for WordPress
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
# phpstan requires PHP 7.1+.
php-version: 7.4
extensions: dom, iconv, json, libxml, zip
coverage: none
tools: cs2pr

- name: Composer Install
run: composer install --optimize-autoloader --prefer-dist

- name: Log debug information
run: |
git --version
php --version
composer --version
- name: Running PHPStan Analyze
if: ${{ success() || failure() }}
run: |
vendor/bin/phpstan --version
vendor/bin/phpstan analyze -vv --memory-limit=2G --error-format=checkstyle | cs2pr
37 changes: 33 additions & 4 deletions .github/workflows/wordpress-org-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,47 @@ jobs:
# DEBUG=pw:api,pw:webserver \
npm run screenshots:wporg -- --update-snapshots
- name: Commit updated screenshots
- name: Checkout new branch
# Using "continue-on-error:true" results in 'conclusion' being a success in any case, while the 'outcome' can differ.
# And, as you already guessed, if: failure() looks at 'conclusion'.
if: ${{ github.event.inputs.updateAllSnapshots || steps.screenshot-tests.outcome == 'failure' }}
run: |
# Remove untracked, temporary file
rm -f ./localized_blueprint.json
git checkout -b fix/wp-org-screenshots-${{ matrix.locale }}-${{ github.sha }}
- name: Compress Images
if: ${{ github.event.inputs.updateAllSnapshots || steps.screenshot-tests.outcome == 'failure' }}
id: compress-images
uses: calibreapp/image-actions@main
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Use the compressOnly option with true value to skip the commit and summary comment.
compressOnly: true
# ignorePaths accepts a comma-separated string with globbing support # https://www.npmjs.com/package/glob
ignorePaths: 'artifacts,build,node_modules/**'

- name: Commit updated screenshots
# Using "continue-on-error:true" results in 'conclusion' being a success in any case, while the 'outcome' can differ.
# And, as you already guessed, if: failure() looks at 'conclusion'.
if: ${{ github.event.inputs.updateAllSnapshots || steps.screenshot-tests.outcome == 'failure' }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
# Remove untracked, temporary file
rm -f ./localized_blueprint.json
git add -A
git commit -m "Screenshots for ${{ matrix.locale }} updated!"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push new branch to origin
# Using "continue-on-error:true" results in 'conclusion' being a success in any case, while the 'outcome' can differ.
# And, as you already guessed, if: failure() looks at 'conclusion'.
if: ${{ github.event.inputs.updateAllSnapshots || steps.screenshot-tests.outcome == 'failure' }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git push origin fix/wp-org-screenshots-${{ matrix.locale }}-${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -191,6 +220,6 @@ jobs:
# Using GitHub CLI in Workflows
# https://docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows
# https://cli.github.com/manual/gh_pr_create
run: gh pr create -B main -H fix/wp-org-screenshots-${{ matrix.locale }}-${{ github.sha }} --title 'Update ${{ matrix.locale }} screenshots for wordpress.org' --body 'Created with ❤️ by WordPress Playground, Playwright & GitHub action'
run: gh pr create -B main -H fix/wp-org-screenshots-${{ matrix.locale }}-${{ github.sha }} --title 'Update ${{ matrix.locale }} screenshots for wordpress.org' --body 'Created with ❤️ by WordPress Playground, Playwright & GitHub action <br /><br />${{ steps.compress-images.outputs.markdown }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ typings
# Composer #
##########
vendor
phpstan.neon

# .wp-env #
##########
Expand Down
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ extend-ignore-re = [

# Case insensitive, matches inside word.
# [default.extend-words]
"Skelton" = "Skelton"
# bellow = "below"
# toi = "toi"
Binary file modified .wordpress-org/banner-1544x500.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/banner-772x250.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-128x128.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-256x256.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1-es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1-fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1-it.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1-mr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1-nl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2-es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2-fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2-it.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2-mr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2-nl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-3-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-3-es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-3-fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-3-it.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-3-mr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-3-nl.png
Binary file modified .wordpress-org/screenshot-3.png
Binary file modified .wordpress-org/screenshot-4-de.png
Binary file modified .wordpress-org/screenshot-4-es.png
Binary file modified .wordpress-org/screenshot-4-fr.png
Binary file modified .wordpress-org/screenshot-4-it.png
Binary file modified .wordpress-org/screenshot-4-mr.png
Binary file modified .wordpress-org/screenshot-4-nl.png
Binary file modified .wordpress-org/screenshot-4.png
Binary file modified .wordpress-org/screenshot-5-de.png
Binary file modified .wordpress-org/screenshot-5-es.png
Binary file modified .wordpress-org/screenshot-5-fr.png
Binary file modified .wordpress-org/screenshot-5-it.png
Binary file modified .wordpress-org/screenshot-5-mr.png
Binary file modified .wordpress-org/screenshot-5-nl.png
Binary file modified .wordpress-org/screenshot-5.png
Binary file modified .wordpress-org/screenshot-6-de.png
Binary file modified .wordpress-org/screenshot-6-es.png
Binary file modified .wordpress-org/screenshot-6-fr.png
Binary file modified .wordpress-org/screenshot-6-it.png
Binary file modified .wordpress-org/screenshot-6-mr.png
Binary file modified .wordpress-org/screenshot-6-nl.png
Binary file modified .wordpress-org/screenshot-6.png
2 changes: 1 addition & 1 deletion build/editor.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('moment', 'react-jsx-runtime', 'wp-blocks', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '78fc112bbc2194a14d45');
<?php return array('dependencies' => array('moment', 'react-jsx-runtime', 'wp-blocks', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'eb33377ea4f6094e38cc');
Loading

0 comments on commit 5a4b97f

Please sign in to comment.