Skip to content

Commit

Permalink
Merge branch 'master' into enhancement/issue-1528
Browse files Browse the repository at this point in the history
  • Loading branch information
datengraben authored Dec 3, 2024
2 parents 0f9e555 + 1b59589 commit 103c085
Show file tree
Hide file tree
Showing 154 changed files with 13,390 additions and 6,869 deletions.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ labels: bug, triage
assignees: ''

---
Plugin Version (or master commit hash):

PHP Version:

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**

Steps to reproduce the behavior:

**Expected behavior**

A clear and concise description of what you expected to happen.

**Screenshots**

If applicable, add screenshots to help explain your problem.
4 changes: 2 additions & 2 deletions .github/actions/build-plugin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand All @@ -32,7 +32,7 @@ runs:
composer install --no-dev --prefer-dist --no-progress
shell: bash

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ updates:
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-name: "*"
dependency-type: "production"
commit-message:
prefix: "npm"
include: "scope"
Expand All @@ -23,9 +20,6 @@ updates:
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-name: "*"
dependency-type: "production"
commit-message:
prefix: "composer"
include: "scope"
19 changes: 12 additions & 7 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
matrix:
php:
- '7.4'
- '8.2'
- '8.3'
core:
- {name: 'tested', version: 'null'}
- {name: 'minimum', version: 'WordPress/WordPress#5.9'}
Expand All @@ -41,15 +41,10 @@ jobs:
- name: Overwrite PHP versions & core for wp-env
if: matrix.core.version != 'null'
run: jq '. + {"phpVersion":"${{ matrix.php }}","core":"${{ matrix.core.version }}"}' tests/cypress/wordpress-files/e2e-override.json > .wp-env.override.json
- name: setup wp env
run: npm run env:start

- name: Overwrite PHP version for wp-env
if: matrix.core.version == 'null'
run: jq '. + {"phpVersion":"${{ matrix.php }}"}' tests/cypress/wordpress-files/e2e-override.json > .wp-env.override.json
- name: setup wp env
run: npm run env:start

- name: install test data for e2e test
run: npm run cypress:setup

Expand All @@ -65,3 +60,13 @@ jobs:
with:
name: cypress-screenshots-${{ matrix.php }}_${{ matrix.core.name }}
path: ${{ github.workspace }}/tests/cypress/screenshots/
rerun-on-failure:
needs: e2e
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yml -r ${{ github.head_ref || github.ref_name }} -F run_id=${{ github.run_id }}
17 changes: 13 additions & 4 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
php:
- '7.4'
- '8.2'
- '8.3'
core:
- { name: 'latest', version: 'latest' }
- { name: 'minimum', version: '5.9' }
Expand Down Expand Up @@ -73,11 +73,20 @@ jobs:
- name: Run test suite
run: |
composer dump-autoload -o
curl -ksSfL -o ~/phpunit-9.phar https://phar.phpunit.de/phpunit-9.phar
php ~/phpunit-9.phar
php vendor/bin/phpunit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/logs/clover.xml
rerun-on-failure:
needs: phpunit
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yml -r ${{ github.head_ref || github.ref_name }} -F run_id=${{ github.run_id }}
19 changes: 19 additions & 0 deletions .github/workflows/rerun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Rerun workflow

on:
workflow_dispatch:
inputs:
run_id:
required: true
jobs:
rerun:
runs-on: ubuntu-latest
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ yarn.lock
cache
commonsbooking.zip
node_modules
./phpunit*
.phpunit.*
/phpunit
assets/packaged
src/Wordpress/.DS_Store
tests/cypress/screenshots
Expand Down
14 changes: 13 additions & 1 deletion .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https:
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="5.6"/>
<config name="minimum_supported_wp_version" value="5.9"/>

<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
Expand Down Expand Up @@ -81,8 +81,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https:

<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<exclude name="Squiz.Commenting.FileComment" />
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop" />

<exclude-pattern>tests/</exclude-pattern>
</rule>

<!-- Adds commonsbooking specific wrappers around wp_kses ... -->
<!-- Note that phpcs as php is case insensitive -->
<rule ref="WordPress.Security.EscapeOutput">
<properties>
<property name="customEscapingFunctions" type="array">
<element value="commonsbooking_sanitizehtml"/>
<element value="commonsbooking_sanitizearrayorstring" />
</property>
</properties>
</rule>

</ruleset>
61 changes: 33 additions & 28 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
{
"phpVersion": "7.4",
"core": "Wordpress/Wordpress#6.4.1",
"plugins": [
".",
"https://downloads.wordpress.org/plugin/wp-crontrol.zip",
"https://downloads.wordpress.org/plugin/wordpress-importer.zip",
"https://downloads.wordpress.org/plugin/query-monitor.zip",
"https://downloads.wordpress.org/plugin/wp-mail-logging.zip",
"https://downloads.wordpress.org/plugin/jsm-show-post-meta.zip",
"https://downloads.wordpress.org/plugin/disable-welcome-messages-and-tips.zip"
],
"port": 1000,
"testsPort": 1001,
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": false
},
"themes": [
"flegfleg/kasimir-theme"
],
"env": {
"tests": {
"mappings": {
"wp-content/plugins/commonsbooking": "."
}
}
}
"phpVersion" : "7.4",
"core" : "Wordpress/Wordpress#6.7",
"plugins" : [
".",
"https://downloads.wordpress.org/plugin/wp-crontrol.zip",
"https://downloads.wordpress.org/plugin/wordpress-importer.zip",
"https://downloads.wordpress.org/plugin/query-monitor.zip",
"https://downloads.wordpress.org/plugin/wp-mail-logging.zip",
"https://downloads.wordpress.org/plugin/jsm-show-post-meta.zip",
"https://downloads.wordpress.org/plugin/disable-welcome-messages-and-tips.zip"
],
"port" : 1000,
"testsPort" : 1001,
"config" : {
"WP_DEBUG" : true,
"WP_DEBUG_LOG" : true,
"WP_DEBUG_DISPLAY" : false
},
"themes" : [
"flegfleg/kasimir-theme"
],
"env" : {
"tests" : {
"mappings" : {
"wp-content/plugins/commonsbooking" : "."
},
"config" : {
"WP_DEBUG" : true,
"WP_DEBUG_LOG" : true,
"WP_DEBUG_DISPLAY" : false
}
}
}
}
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CommonsBooking is a plugin for the management and booking of common goods. This
* [WordPress Plugin Page](https://wordpress.org/plugins/commonsbooking/)
* [View Changelog](https://wordpress.org/plugins/commonsbooking/#developers)
* [Official Website](https://commonsbooking.org)
* For users get [Support](https://commonsbooking.org/kontakt/)
* For users read the [documentation](https://commonsbooking.org/dokumentation) or get [Support](https://commonsbooking.org/kontakt/)
* For developers use the [Bug-Tracker](https://github.com/wielebenwir/commonsbooking/issues)

## Installation
Expand Down
Loading

0 comments on commit 103c085

Please sign in to comment.