Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/composer/phpunit/phpunit-tw-11
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Sep 24, 2024
2 parents 49ea52e + 371ff44 commit e3dbe4b
Show file tree
Hide file tree
Showing 59 changed files with 787 additions and 611 deletions.
4 changes: 4 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
/.wordpress-org
/.git
/.github
/.idea
/.phpunit.cache
/bin
/build
/diagrams
/docs
/legacy-tests
/multisite-language-switcher
/node_modules
/src
/tests
.distignore
.gitattributes
.gitignore

.scrutinizer.yml
Changelog.md
Diagrams.md
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Composer dependencies
run: composer install --no-dev
- name: Build
run: |
npm install
npm run build
run: composer install --no-dev --no-interaction --optimize-autoloader
- name: Composer build
run: composer run-script build
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Plugin Check
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- master
- 'releases/*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Composer dependencies
run: composer install --no-dev --no-interaction --optimize-autoloader
- name: Build
run: composer run-script build
- name: Run plugin check
uses: wordpress/plugin-check-action@v1
with:
build-dir: './multisite-language-switcher'
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Test
name: UnitTests and CodeCoverage
on: [push]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Composer dependencies
run: composer install
- name: Run Testsuite
Expand All @@ -16,7 +16,7 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout project
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Composer dependencies
run: composer install
- name: Run Testsuite
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.idea/
.phpunit.result.cache
.phpunit.cache
composer.lock
composer.phar
multisite-language-switcher/
multisite-language-switcher.zip
package-lock.json
phpunit.xml.bak
.idea/
.phpunit.result.cache
.phpunit.cache
tests/coverage/
tests/playwright-results/
tests/playwright-report/
Expand Down
1 change: 1 addition & 0 deletions MultisiteLanguageSwitcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function get_the_msls( $attr ): string {
* @param string[] $arr
*/
function the_msls( array $arr = array() ): void {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo get_the_msls( $arr );
}

Expand Down
2 changes: 1 addition & 1 deletion bin/git-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ ZIP_ARCHIVE="$PROJECT_ROOT/$PLUGIN_NAME.zip"
rm -f $ZIP_ARCHIVE
rm -rf $BUILD_PATH && mkdir $BUILD_PATH

rsync -arvp --exclude-from=$PROJECT_ROOT/build/exclude $PROJECT_ROOT/ $BUILD_PATH/
rsync -arvp --exclude-from=$PROJECT_ROOT/.distignore $PROJECT_ROOT/ $BUILD_PATH/
cd $PROJECT_ROOT && zip -r $ZIP_ARCHIVE $PLUGIN_NAME
2 changes: 1 addition & 1 deletion build/translations.json

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"squizlabs/php_codesniffer": "^3.9",
"phpcompatibility/php-compatibility": "^9.3",
"wp-coding-standards/wpcs": "^3.0",
"smeghead/php-class-diagram": "^1.3"
"smeghead/php-class-diagram": "^1.3",
"phpstan/phpstan-mockery": "^1.1"
},
"autoload": {
"psr-4": {
Expand All @@ -44,6 +45,18 @@
"flags-svg": "php bin/flags-svg.php > css/flags.php",
"diagram:class": "vendor/bin/php-class-diagram --php8 includes > diagrams/msls-class.puml",
"diagram:package": "vendor/bin/php-class-diagram --package-diagram --php8 includes > diagrams/msls-package.puml",
"git-release": "bin/git-release.sh",
"build": [
"@prepare",
"@flags-png",
"@flags-svg",
"npm install",
"npm run build",
"npm run uglify",
"npm run less",
"npm run build-msls-block",
"@git-release"
],
"githooks": [
"if [ -e bin/githooks/pre-commit ]; then cp bin/githooks/pre-commit ./.git/hooks/; fi",
"if [ -e .git/hooks/pre-commit ]; then chmod 0755 .git/hooks/pre-commit; fi"
Expand Down
Loading

0 comments on commit e3dbe4b

Please sign in to comment.