Skip to content

Commit

Permalink
Add WP Plugin Check
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-mendonca authored Feb 1, 2024
1 parent fef8f29 commit 0e39a7a
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: WP Plugin Check

on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
paths:
# Any change to a PHP, JavaScript, CSS/SCSS or Markdown file should run checks.
- '**.js'
- '**.php'
- '**.*css'
- '**.md'
# These files configure NPM. Changes could affect the outcome.
- 'package*.json'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This file configures ESLint. Changes could affect the outcome.
- '.eslintrc.json'
# This file configures Stylelint. Changes could affect the outcome.
- '.stylelintrc.json'
# This file configures Markdownlint. Changes could affect the outcome.
- '.markdownlint.json'
# This file configures PHPCS. Changes could affect the outcome.
- 'phpcs.xml.dist'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/*.yml'
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:

jobs:
# Runs the WP Plugin Check.
#
# Checks from the Plugin Review Team.
#
# For the detailed list of checks:
# - https://wordpress.org/plugins/plugin-check/
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up PHP.
# - Installs Composer dependencies.
# - Runs the Plugin Check.
plugin-check:
name: Plugin Check
runs-on: ubuntu-latest

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

- name: Set up PHP
uses: shivammathur/setup-php@2.29.0
with:
php-version: '7.4'
coverage: none
env:
fail-fast: false

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--no-dev"

- name: Copy the plugin files to the plugin check folder, excluding the files on .distignore.
run: rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" "$GITHUB_WORKSPACE/" translation-stats/ --delete --delete-excluded

- name: Run plugin check
uses: swissspidy/wp-plugin-check-action@v1.0.3
with:
build-dir: 'translation-stats'

0 comments on commit 0e39a7a

Please sign in to comment.