Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
sdobreff committed Jun 4, 2024
2 parents feb82b4 + 936bfd2 commit 7c8a2b0
Show file tree
Hide file tree
Showing 143 changed files with 3,966 additions and 5,763 deletions.
Empty file modified .editorconfig
100644 → 100755
Empty file.
Empty file modified .eslintignore
100644 → 100755
Empty file.
Empty file modified .eslintrc.js
100644 → 100755
Empty file.
17 changes: 17 additions & 0 deletions .github/run-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -eu

cp .env.github .env

export PATH="$(pwd)/vendor/bin:$PATH"

composer run vendor-install
composer install
composer wp-install

if [ "$(wp-install --status)" = "full" ]; then
wp-install --serve &
fi

composer test
73 changes: 73 additions & 0 deletions .github/workflows/free-repo-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a basic workflow that is manually triggered

name: Free repo sync

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
free_pat:
# Friendly description to be shown in the UI instead of 'name'
description: 'Personal access token for the free plugin repository'
# Default value if no value is explicitly provided
default: ''
# Input has to be provided for the workflow to run
required: true
source_branch:
description: 'Source branch'
default: 'develop'
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
sync:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Check out the premium plugin repository
uses: actions/checkout@v2
with:
path: premium
ref: ${{ github.event.inputs.source_branch }}
- name: Check out the free plugin repository
uses: actions/checkout@v2
with:
path: free
ref: develop
repository: WPWhiteSecurity/wp-2fa
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install node dependencies
run: rm -rf node_modules; rm package-lock.json; rm TESTS.MD; npm cache clear --force; npm install; npm run vendor:install; npm run prod --
working-directory: premium
- name: Convert premium plugin to free version
run: npm run-script convert:free
working-directory: premium
- name: Remove premium translation files and other premium only files
run: rm -Rf extensions freemius languages
working-directory: premium
- name: Substitute Year in code
run: gulp substitute-year
working-directory: premium
- name: Generate POT file for the free edition
run: gulp translate
working-directory: premium
- name: Sync changes from premium to free plugin in action workspace
# third-party is also excluded as it currently does not seem to be working
run: rsync -arvz --delete --exclude "/third-party" --exclude "/node_modules" --exclude "/.git" --exclude "/.github" --exclude "/*.json" --exclude "/*.js" --exclude "/*.md" --exclude "/*.sh" --exclude "/readme.txt" --exclude "/docker" --exclude "codeception*.yml" premium/ free
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: 'Automated sync from the premium version of the plugin'
commit-message: '[create-pull-request] automated changes sync'
path: free
token: ${{ github.event.inputs.free_pat }}
branch-suffix: random
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run tests

on: [push, pull_request]

jobs:
test:
services:
mariadb:
image: mariadb
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
# Ensure docker waits for mariadb to start
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/cache@v1
id: cache-composer
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer

- uses: actions/cache@v1
id: cache-wp-cli
with:
path: ~/.wp-cli/cache
key: ${{ runner.os }}-wp-cli

- name: Run tests
run: .github/run-tests
Empty file modified .github/workflows/wpcs.yml
100644 → 100755
Empty file.
48 changes: 40 additions & 8 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ Thumbs.db
**/.sass-cache/*
**/.map

# Composer #
##########
!assets/js/vendor/
wpcs/
vendor
!vendor/composer
!vendor/*.php

# Bower #
##########
assets/bower_components/*
Expand All @@ -72,3 +64,43 @@ assets/bower_components/*
##########
assets/img/.DS_Store
.vscode/

node_modules
bower_components
release
third-party/*
vendor/*
builds/*
php-scoper/vendor/*
dist/*
.idea
*.log

# Editors
*.esproj
*.tmproj
*.tmproject
tmtags
.*.sw[a-z]
*.un~
Session.vim
*.swp

# Mac OSX
.DS_Store
._*
.Spotlight-V100
.Trashes

# Windows
Thumbs.db
Desktop.ini
.vscode/launch.json

/tests/_support/_generated/
/.wp-install/
/.env

/testing/

composer\.lock
45 changes: 45 additions & 0 deletions .gitpod-vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9001
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9001,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
59 changes: 59 additions & 0 deletions .gitpod-vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"editor.detectIndentation": true,
"editor.renderWhitespace": "all",
"editor.formatOnPaste": false,
"editor.formatOnSave": false,
"blockman.n01LineHeight": 23,
"blockman.n02EachCharFrameWidth": 9.321,
"blockman.n23AnalyzeSquareBrackets": true,
"phpsab.fixerEnable": true,
"phpsab.snifferEnable": true,
"phpsab.snifferMode": "onSave",
"phpsab.snifferTypeDelay": 250,
"phpsab.snifferShowSources": true,
"phpsab.executablePathCS": "/usr/local/bin/phpcs",
"phpsab.executablePathCBF": "/usr/local/bin/phpcbf",
"phpsab.standard": "WordPressOrg,WordPress-ExtraOrg,WordPress-DocsOrg",
/* WordPress-Extra,WordPress,,WordPress-Docs */
"phpsab.debug": false,
"phpsab.allowedAutoRulesets": [
".phpcs.xml",
".phpcs.xml.dist",
"phpcs.xml",
"phpcs.xml.dist",
"phpcs.ruleset.xml",
"ruleset.xml"
],
"phpmd.rules": "codesize,design,unusedcode,naming",
"namespaceResolver.autoImportOnSave": true,
"phpResolver.phpLogFile": "/var/www/html-multi/wp-content/debug.log",
"phpResolver.phpLogFilePathRemote": "",
"phpResolver.phpLogFilePathLocal": "",
"phpResolver.phpBeautifierCommand": "/usr/bin/phpcbf",
"phpResolver.phpSnifferCommand": "/usr/bin/phpcs",
"phpResolver.phpStandards": "WordPress,WordPress-Extra,WordPress-Docs",
"php-docblocker.returnGap": true,
"php-docblocker.qualifyClassNames": true,
"php-docblocker.extra": [
"",
"@since latest"
],
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#1073cf2d",
"editor.lineHighlightBorder": "#9fced11f"
},
"editor.wordWrap": "on",
"editor.guides.indentation": true,
"editor.inlayHints.enabled": "on",
"editor.guides.bracketPairs": true,
"editor.guides.bracketPairsHorizontal": true,
"intelephense.completion.fullyQualifyGlobalConstantsAndFunctions": true,
"php.suggest.basic": false,
"php.validate.enable": false,
"[php]": {
"editor.defaultFormatter": "StoilDobreff.php-resolver"
},
"cSpell.words": [
"phpcs"
],
}
40 changes: 40 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
image:
file: .gitpod/.gitpod.dockerfile

ports:
- port: 8080
onOpen: open-preview
- port: 3306
onOpen: ignore
- port: 8025
onOpen: ignore
- port: 1025
onOpen: ignore
- port: 9000
onOpen: ignore

tasks:
- name: Some init
command: |
sudo service mysql start
sudo service php8.3-fpm start
sudo service nginx start
sudo mailhog </dev/null &>/dev/null & disown
/bin/bash .gitpod/.init.sh
vscode:
extensions:
- eamodio.gitlens
- felixfbecker.php-debug
- sleistner.vscode-fileutils
- streetsidesoftware.code-spell-checker
- mrmlnc.vscode-duplicate
- usernamehw.errorlens
- RobertOstermann.inline-parameters-extended
- zaaack.markdown-editor
- neilbrayfield.php-docblocker
- felixfbecker.php-pack
- bmewburn.vscode-intelephense-client
- StoilDobreff.php-resolver
- ms-vscode.sublime-keybindings
- sdras.night-owl
5 changes: 5 additions & 0 deletions .gitpod/.gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Gitpod docker image for WordPress | https://github.com/sdobreff/docker-bb-ci
# License: MIT (c) 2023
# Version: 1.0

FROM sdobreff/gitpod:latest
Loading

0 comments on commit 7c8a2b0

Please sign in to comment.