-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing wpcom site helper plugin into the Monorepo. #37737
Changes from 250 commits
3b64b01
4c5da0b
953945c
9b8ca88
6046151
b2e9f99
55d8a75
591b1a5
9061679
752f708
ebd300e
c446b2d
da25971
8fcc204
cea4aa5
5a1215e
f48273e
710a0b4
7ba2655
c4c82e2
22b61a9
ccbd858
f556236
5cd2f99
98c3b6d
69a6b8d
fe560fa
3e1d0db
150b1e4
181a708
df14653
da11d95
c980daf
daef393
5e05759
d57ce8a
3bd314e
e7f0db9
97787cc
1eed1cf
c130817
5889ccf
0d112be
71d86f7
0dc345b
8e4d972
02a641e
f754be9
9d5d4cc
85a2446
1a355bc
6b851ad
8aa8d75
97db02e
c33223d
16511d6
1f4e838
52a7ebc
3563af1
78a21f7
6ef5725
d09333b
3ffd5e3
70df592
9d7be8c
8040ce4
a702395
6a56f89
9083956
cc69cb9
6e77157
9c141c2
55ca871
9ab125c
10939a6
8f37b95
562c46e
075e304
705e46c
d7c966b
5c7e05f
ee799be
b427805
b0a8ecf
fe0626d
f83f93a
014ebcf
67ae23f
7195f02
c9b7faf
69bb182
eda6523
83f6b18
7ad18e0
3febe64
2d213a5
2551a31
a96877a
4826953
5418e42
c997c7d
b573a33
03bd9ca
7f97eaa
ccc84f5
99946d6
48c8425
d415d2a
eac07a2
e337181
dede568
aff6aee
f0869ac
bd79c10
35e0d57
9056b24
efe80d2
e566cd2
fa6f12a
fc2f47b
bdae75f
037a904
33ea966
3a776d3
ca258ae
beed7ea
933bc00
ade5d0a
f466cdf
699216f
d81785a
a205f15
4f5f9c4
26611ba
f028945
8620544
4dd6ca7
4ede766
d30c094
8d96e1c
43e13aa
6b56d26
1cfd108
904ca0d
6272918
7c369c7
547830e
9b7c851
b87d215
34f1ce9
5b82981
4eb0189
da312eb
0927afe
d8e87ff
02a04c3
161f339
c40e4ef
59bc35f
c055644
7f863f8
c8019c0
4e0b6d9
65e7808
e5c4efe
97800a2
1a4d94b
435f0ee
9795684
9f21281
23da14a
70cd661
7fab7fd
246d480
f8aac28
3c1a51f
c5b1c77
7a72d2c
521f1c9
3462ba0
7a2d6a9
a4ee654
93800dd
0f5515a
2e20b20
5d1fb99
bfe409a
9532e0d
99a1da8
e67cc3b
f9bef42
a425384
5514da1
5a9edfb
4fce17e
934c349
726b3f7
6932eb9
8176412
5ce21cd
84ffd16
141ec33
3bacaf8
f8cf199
3663776
820fe46
8ad9c19
575b5fd
0684c39
f437bff
fece2ca
2be3f17
db07f61
559919e
dcbc147
ac34fb5
1319950
36b4334
2bff31b
2b8cfc2
c5b68f4
75cb6be
6ccd34c
1635ae8
e640cd9
e1a95d7
87b268a
b79c93d
ce4e1e9
3148c75
798870f
9c06fc1
a3469b6
9b65ee7
de1f5fe
7bf4c35
cb613a2
2d5ff64
73c68fa
75daa5e
2b46227
55c6331
e79719a
79a3ebb
34dbe5a
b2ab817
1a8f0f1
5b4875c
0e38e6e
0d115b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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. |
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 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still useful, or should we delete it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing, this was introduced with docker-based CircleCI tests, let's keep that as a reminder to make it work with GH CI. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
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', | ||
}, | ||
}; |
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 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still useful, or should we delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it and turn it into a GitHub CI action that tests on a self-hosted runner, but do it in a separate PR.