Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Dec 18, 2024
2 parents 6941711 + 4542f8a commit 1e35ee9
Show file tree
Hide file tree
Showing 229 changed files with 21,361 additions and 8,598 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ tests/*
vendor/*
bin/*
hookdocs/*
docs/*
9 changes: 7 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@
"Headers": "readonly",
"requestAnimationFrame": "readonly",
"React": "readonly",
"Block": "readonly"
"Block": "readonly",
"classifai_term_cleanup_params": "readonly",
"classifAISettings": "readonly"
},
"rules": {
"react/jsx-no-undef": "off"
},
"extends": ["plugin:@wordpress/eslint-plugin/recommended"],
"ignorePatterns": ["*.json"]
"ignorePatterns": ["*.json", "webpack.config.js"]
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ hookdoc-conf.json export-ignore
LICENSE.md export-ignore
package-lock.json export-ignore
package.json export-ignore
phpcs-compat.xml.dist export-ignore
phpcs.xml.dist export-ignore
phpstan.neon.dist export-ignore
phpunit.xml.dist export-ignore
README.md export-ignore
webpack.config.js export-ignore
23 changes: 23 additions & 0 deletions .github/blueprints/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/wp-admin/tools.php?page=classifai#/language_processing?welcome_guide=1",
"preferredVersions": {
"php": "7.4",
"wp": "latest"
},
"features": {
"networking": true
},
"steps": [
{
"step": "installPlugin",
"pluginData": {
"resource": "url",
"url": "https://github-proxy.com/proxy/?repo=10up/classifai&branch=stable"
},
"options": {
"activate": true
}
}
]
}
41 changes: 37 additions & 4 deletions .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,58 @@ name: Build release zip

on:
workflow_dispatch:
workflow_call:

jobs:
build_zip:
name: Build release zip
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Node.js 16.x

- name: Setup node
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version-file: .nvmrc
- name: npm install and build

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
id: cache-composer
uses: actions/cache@v4
env:
cache-name: cache-composer
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}

- name: Install node dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --no-optional

- name: Install composer dependencies
run: composer install --no-dev -o

- name: Build
run: |
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Upload the ZIP file as an artifact
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
3 changes: 2 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#6.1'}
- {name: 'WP minimum', version: 'WordPress/WordPress#6.5'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v4
uses: actions/dependency-review-action@v4.3.3
with:
license-check: true
vulnerability-check: false
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: JS Linting

on:
push:
branches:
- develop
- trunk
paths:
- '**.js'
- '**.json'
pull_request:
branches:
- develop
paths:
- '**.js'
- '**.json'

jobs:
eslint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node and npm cache
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Install Node dependencies
run: npm ci --omit=optional

- name: Get updated JS files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
**/*.js
**/*.json
- name: Run JS linting
run: |
if [[ "${{ steps.changed-files.outputs.any_changed }}" == 'true' && "${{ github.event_name }}" == "pull_request" ]]; then
npx wp-scripts lint-js ${{ steps.changed-files.outputs.all_changed_files }}
elif [[ "${{ github.event_name }}" == "push" ]]; then
npm run lint:js
fi
107 changes: 0 additions & 107 deletions .github/workflows/lint.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/php-compat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PHP Compatibility

on:
push:
branches:
- develop
- trunk
paths:
- "**.php"
pull_request:
branches:
- develop
paths:
- "**.php"

jobs:
php-compatibility:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}

- name: Install dependencies
run: composer install --prefer-dist

- name: Run PHP Compatibility
run: ./vendor/bin/phpcs --standard=./phpcs-compat.xml.dist -p .
Loading

0 comments on commit 1e35ee9

Please sign in to comment.