Skip to content

Commit

Permalink
Move to GitHub actions (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd authored Mar 24, 2022
1 parent 5af18d5 commit 991ef3c
Show file tree
Hide file tree
Showing 32 changed files with 17,141 additions and 2,060 deletions.
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"
}
}
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.

- 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

0 comments on commit 991ef3c

Please sign in to comment.