Skip to content
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

Move to GitHub actions #436

Merged
merged 47 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f86b5fa
Enforce consistent Node version for tooling
kasparsd Mar 23, 2022
8ee02d6
Make the lock file match the new standard
kasparsd Mar 23, 2022
f2d9d14
Remove Travis config
kasparsd Mar 23, 2022
ffdda0c
Add wp-env
kasparsd Mar 23, 2022
2eebbf4
Add local phpunit tests
kasparsd Mar 24, 2022
1180fac
No longer needed
kasparsd Mar 24, 2022
4ae4131
Allow local overrides and make the default dist
kasparsd Mar 24, 2022
5c1f0a1
Directories are directories
kasparsd Mar 24, 2022
12eda59
Ignore all meta files
kasparsd Mar 24, 2022
e27fbb2
Install the helper to run multiple commands in a cross-compat way
kasparsd Mar 24, 2022
67e7da4
Prevent from being published
kasparsd Mar 24, 2022
f1fea7a
Use the markdown readme for contributor specific instructions
kasparsd Mar 24, 2022
0923c3f
Don’t need to generate the readme anymore
kasparsd Mar 24, 2022
f01d8f6
No longer needed
kasparsd Mar 24, 2022
f76e22c
Work around wp-env hardcoded config
kasparsd Mar 24, 2022
8b0d959
Additional commands
kasparsd Mar 24, 2022
d041d20
Add the test job
kasparsd Mar 24, 2022
fcf8b29
Reference test sub-tasks correctly
kasparsd Mar 24, 2022
db995e2
Setup PHP tooling
kasparsd Mar 24, 2022
092fcfd
Per WPCS
kasparsd Mar 24, 2022
298fcc5
Add formatting scripts
kasparsd Mar 24, 2022
469875b
Automatic formatting
kasparsd Mar 24, 2022
4bca847
Format per rules
kasparsd Mar 24, 2022
c5d7f2f
Add linters for JS and CSS
kasparsd Mar 24, 2022
be3b6e2
Override the config for this
kasparsd Mar 24, 2022
a3f687c
Don’t enforce the dangling comma for backwards compat
kasparsd Mar 24, 2022
49e40e6
No longer users
kasparsd Mar 24, 2022
34b9b43
Format per WPCS
kasparsd Mar 24, 2022
e796910
Wasn’t used
kasparsd Mar 24, 2022
2f2f165
Format per WPCS
kasparsd Mar 24, 2022
9e57397
Add the JS linters
kasparsd Mar 24, 2022
0ba236a
Add the badge
kasparsd Mar 24, 2022
beb0f9a
Add PHP compat checks
kasparsd Mar 24, 2022
4387b3f
This is already wrapped in a conditional
kasparsd Mar 24, 2022
df1abf1
Format and don’t adjust severity
kasparsd Mar 24, 2022
fff0c2c
Add VIP rules too
kasparsd Mar 24, 2022
9caa46e
Introduce a custom ruleset that ignores WP errors and allows compat c…
kasparsd Mar 24, 2022
f704a54
Per VIP coding standards
kasparsd Mar 24, 2022
4b51177
Check those during CI
kasparsd Mar 24, 2022
1c39838
Update deps
kasparsd Mar 24, 2022
1cabf98
Ignore meta files for dist
kasparsd Mar 24, 2022
1187c3c
Add WP core to distinclude
kasparsd Mar 24, 2022
0785d00
Latest install
kasparsd Mar 24, 2022
c6b566d
Comments for readability
kasparsd Mar 24, 2022
e9ad530
Mark as valid use case
kasparsd Mar 24, 2022
c6480fc
Use the correct flag to disable the line
kasparsd Mar 24, 2022
a9a1c42
Add a reminder for now
kasparsd Mar 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.*
/tests/
/vendor/
/node_modules/
/wordpress/
/Gruntfile.js
/composer.json
/composer.lock
Expand All @@ -7,8 +11,5 @@
/npm-debug.log
/docker-compose.yml
/readme.md
/phpcs.xml
/phpunit.xml
/tests
/vendor
/node_modules
/phpcs*
/phpunit*
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [ "plugin:@wordpress/eslint-plugin/es5" ],
"rules": {
"comma-dangle": "off"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We keep this for IE compat as that's what we currently have.

}
}
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test

on: push

jobs:

lint:
name: Lint and Test
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version-file: '.nvmrc'

- name: Setup PHP and Composer
uses: shivammathur/setup-php@v2
with:
php-version: '5.6'
tools: composer:v2

- name: Install NPM dependencies
run: npm install

- name: Lint JS
run: npm run lint:js

- name: Lint CSS
run: npm run lint:css

- name: Lint PHP
run: npm run lint:php || true # Ignore for now.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of WordPress linter errors that need to be fixed.


- name: Start the Docker testing environment
run: npm run env start --xdebug=coverage

- name: Test
run: npm run test

- name: Build
run: npm run build
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
/node_modules
/node_modules/
/npm-debug.log
/vendor
/dist
/tests/logs
/vendor/
/dist/
/tests/logs/
/wordpress/
10 changes: 0 additions & 10 deletions .jscsrc

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"core": "./wordpress",
"phpVersion": "7.4",
"plugins": [ "." ]
}
3 changes: 1 addition & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jshint es3:false, node:true, esversion: 6 */
/* eslint-env node,es6 */

const ignoreParse = require( 'parse-gitignore' );

Expand Down Expand Up @@ -54,5 +54,4 @@ module.exports = function( grunt ) {
'wp_deploy:trunk',
]
);

};
32 changes: 16 additions & 16 deletions class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,34 +680,34 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg
</div>
<?php endif; ?>
<style>
/* @todo: migrate to an external stylesheet. */
.backup-methods-wrap {
/* @todo: migrate to an external stylesheet. */
.backup-methods-wrap {
margin-top: 16px;
padding: 0 24px;
}
.backup-methods-wrap a {
}
.backup-methods-wrap a {
color: #999;
text-decoration: none;
}
ul.backup-methods {
}
ul.backup-methods {
display: none;
padding-left: 1.5em;
}
/* Prevent Jetpack from hiding our controls, see https://github.com/Automattic/jetpack/issues/3747 */
.jetpack-sso-form-display #loginform > p,
.jetpack-sso-form-display #loginform > div {
}
/* Prevent Jetpack from hiding our controls, see https://github.com/Automattic/jetpack/issues/3747 */
.jetpack-sso-form-display #loginform > p,
.jetpack-sso-form-display #loginform > div {
display: block;
}
}
</style>

<?php
if ( ! function_exists( 'login_footer' ) ) {
include_once TWO_FACTOR_DIR . 'includes/function.login-footer.php';
}
if ( ! function_exists( 'login_footer' ) ) {
include_once TWO_FACTOR_DIR . 'includes/function.login-footer.php';
}

login_footer();
?>
<?php
<?php
}

/**
Expand Down Expand Up @@ -979,7 +979,7 @@ public static function user_two_factor_options( $user ) {
*
* @param WP_User $user The user.
*/
do_action_deprecated( 'two-factor-user-options-' . $class, array( $user ), '0.7.0', 'two_factor_user_options_' . $class );
do_action_deprecated( 'two-factor-user-options-' . $class, array( $user ), '0.7.0', 'two_factor_user_options_' . $class );
do_action( 'two_factor_user_options_' . $class, $user );
?>
</td>
Expand Down
17 changes: 16 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"config": {
"platform": {
"php": "5.6.20"
},
"allow-plugins": {
"roots/wordpress-core-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"require": {
Expand All @@ -20,6 +24,17 @@
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
"wp-coding-standards/wpcs": "^2.3",
"xwp/wp-dev-lib": "^1.0"
"roots/wordpress": "^5.9",
"wp-phpunit/wp-phpunit": "^5.9",
"phpunit/phpunit": "^5",
"yoast/phpunit-polyfills": "^1.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"automattic/vipwpcs": "^2.3"
},
"scripts": {
"lint": "phpcs",
"test": "phpunit",
"format": "phpcbf"
}
}
Loading