-
Notifications
You must be signed in to change notification settings - Fork 800
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 #37737 from Automattic/add/converge-wpcomsh
Introducing wpcom site helper plugin into the Monorepo.
- Loading branch information
Showing
493 changed files
with
313,890 additions
and
6 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,4 @@ | ||
Significance: minor | ||
Type: other | ||
|
||
Added ability to test Jetpack together with wpcomsh. |
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
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
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
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
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,95 @@ | ||
workflows: | ||
version: 2 | ||
main: | ||
jobs: | ||
- php74-build | ||
- php80-build | ||
- php81-build | ||
- public-access | ||
- private-access | ||
|
||
version: 2 | ||
|
||
job-references: | ||
mariadb_image: &mariadb_image | ||
cimg/mariadb:10.11 | ||
|
||
setup_environment: &setup_environment | ||
name: "Setup Environment Variables" | ||
command: | | ||
echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV | ||
source /home/circleci/.bashrc | ||
install_dependencies: &install_dependencies | ||
name: "Install Dependencies" | ||
command: | | ||
sudo apt-get update && sudo apt-get install subversion mariadb-client rsync | ||
php_job: &php_job | ||
environment: | ||
- WP_TESTS_DIR: "/tmp/wordpress-tests-lib" | ||
- WP_CORE_DIR: "/tmp/wordpress/" | ||
steps: | ||
- checkout | ||
- run: *setup_environment | ||
- run: *install_dependencies | ||
- run: | ||
name: "Run Tests" | ||
command: | | ||
composer global require "phpunit/phpunit=^9.6" --ignore-platform-reqs --dev | ||
composer global require "yoast/phpunit-polyfills" --ignore-platform-reqs --dev | ||
rm -rf $WP_TESTS_DIR $WP_CORE_DIR | ||
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest | ||
echo "Building wpcomsh" | ||
make build | ||
echo "php -l the build/" | ||
find build/ -name "*.php" | xargs -I X php -l X | ||
echo "Copying build to mu-plugins" | ||
mkdir -p ${WP_CORE_DIR}wp-content/mu-plugins/ | ||
cp -r ./build/wpcomsh ${WP_CORE_DIR}wp-content/mu-plugins/ | ||
echo "Linking the wpcomsh-loader.php file into mu-plugins"; | ||
ln -s ${WP_CORE_DIR}wp-content/mu-plugins/wpcomsh/wpcomsh-loader.php ${WP_CORE_DIR}wp-content/mu-plugins/wpcomsh-loader.php | ||
mysql -uroot --protocol=tcp -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password AS '';" | ||
phpunit | ||
WP_MULTISITE=1 phpunit | ||
jobs: | ||
php74-build: | ||
<<: *php_job | ||
docker: | ||
- image: cimg/php:7.4 | ||
- image: *mariadb_image | ||
|
||
php80-build: | ||
<<: *php_job | ||
docker: | ||
- image: cimg/php:8.0 | ||
- image: *mariadb_image | ||
|
||
php81-build: | ||
<<: *php_job | ||
docker: | ||
- image: cimg/php:8.1 | ||
- image: *mariadb_image | ||
|
||
public-access: | ||
docker: | ||
- image: circleci/buildpack-deps:buster | ||
steps: | ||
- run: sudo su -c "apt-get update && apt-get -y upgrade && apt-get -y install composer rsync" | ||
- run: php -v | ||
- add_ssh_keys | ||
- checkout | ||
- setup_remote_docker | ||
- run: make test-public-access | ||
|
||
private-access: | ||
docker: | ||
- image: circleci/buildpack-deps:buster | ||
steps: | ||
- run: sudo su -c "apt-get update && apt-get -y upgrade && apt-get -y install composer rsync" | ||
- run: php -v | ||
- add_ssh_keys | ||
- checkout | ||
- setup_remote_docker | ||
- run: make test-private-access |
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 @@ | ||
node_modules |
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,29 @@ | ||
const loadIgnorePatterns = require( 'jetpack-js-tools/load-eslint-ignore.js' ); | ||
|
||
module.exports = { | ||
root: true, | ||
extends: [ | ||
require.resolve( 'jetpack-js-tools/eslintrc/jest' ), | ||
require.resolve( 'jetpack-js-tools/eslintrc/prettier' ), | ||
], | ||
ignorePatterns: loadIgnorePatterns( __dirname ), | ||
overrides: [], | ||
env: { | ||
browser: true, | ||
jest: true, | ||
node: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
}, | ||
globals: {}, | ||
settings: {}, | ||
rules: { | ||
'jest/no-disabled-tests': 'warn', | ||
'jest/no-focused-tests': 'error', | ||
'jest/no-identical-title': 'error', | ||
'jest/prefer-to-have-length': 'warn', | ||
'jest/valid-expect': 'error', | ||
}, | ||
}; |
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,50 @@ | ||
# Files not needed to be distributed in the package. | ||
.gitattributes export-ignore | ||
.github/ export-ignore | ||
package.json export-ignore | ||
|
||
# Files to include in the mirror repo, but excluded via gitignore | ||
# Remember to end all directories with `/**` to properly tag every file. | ||
# /src/js/example.min.js production-include | ||
# Files to include in Automattic/wpcom-site-helper | ||
/vendor/** production-include | ||
/vendor/autoload.php production-include | ||
/vendor/automattic/** production-include | ||
/vendor/composer/** production-include | ||
/vendor/tubalmartin/** production-include | ||
|
||
# Files to exclude from the mirror repo, but included in the monorepo. | ||
# Remember to end all directories with `/**` to properly tag every file. | ||
.eslintignore production-exclude | ||
.dockerignore production-exclude | ||
.editorconfig production-exclude | ||
composer.lock production-exclude | ||
/.circleci/** production-exclude | ||
/.gitignore production-exclude | ||
/.phpcsignore production-exclude | ||
/.phpcs.dir.xml production-exclude | ||
/.phpcs.dir.phpcompatibility.xml production-exclude | ||
/changelog/** production-exclude | ||
/jetpack_vendor/automattic/**/README.md production-exclude | ||
/jetpack_vendor/automattic/**/src/css/*.scss production-exclude | ||
/jetpack_vendor/automattic/**/composer.json production-exclude | ||
/node_modules/** production-exclude | ||
/phpunit.xml.dist production-exclude | ||
/README.md production-exclude | ||
/vendor/automattic/**/src/css/*.scss production-exclude | ||
/vendor/automattic/**/composer.json production-exclude | ||
/vendor/automattic/jetpack-autoloader/** production-exclude | ||
/vendor/automattic/jetpack-changelogger/** production-exclude | ||
/vendor/automattic/jetpack-composer-plugin/** production-exclude | ||
/vendor/**/.git* production-exclude | ||
/vendor/**/.git*/** production-exclude | ||
/vendor/**/*.md production-exclude | ||
**/*.md production-exclude | ||
/bin/** production-exclude | ||
/build/** production-exclude | ||
/tests/** production-exclude | ||
/.circleci/** production-exclude | ||
.*ntrc production-exclude | ||
Makefile production-exclude | ||
*.mdown production-exclude | ||
error_log production-exclude |
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,43 @@ | ||
name: PHP Lint | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
phpcs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check existence of composer.json & phpcs.xml.dist files | ||
id: check_files | ||
uses: andstor/file-existence-action@v2 | ||
with: | ||
files: "composer.json, phpcs.xml.dist" | ||
|
||
- name: Set up PHP environment | ||
if: steps.check_files.outputs.files_exists == 'true' | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
tools: cs2pr | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} | ||
|
||
- name: Install Composer dependencies & cache dependencies | ||
if: steps.check_files.outputs.files_exists == 'true' | ||
uses: "ramsey/composer-install@v2" | ||
env: | ||
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }} | ||
with: | ||
# Bust the cache at least once a month - output format: YYYY-MM. | ||
custom-cache-suffix: $(date -u "+%Y-%m") | ||
|
||
- name: Detect coding standard violations (Expand for details) | ||
# continue-on-error: true | ||
run: composer phpcs --report-full --report-checkstyle=./phpcs-report.xml | ||
|
||
- name: Show coding standard violations in PR (Expand above section for details) | ||
run: cs2pr --graceful-warnings ./phpcs-report.xml |
Oops, something went wrong.