Skip to content

Commit

Permalink
Different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-mendonca committed Jul 16, 2024
1 parent 98726ad commit 64c6127
Showing 1 changed file with 6 additions and 39 deletions.
45 changes: 6 additions & 39 deletions .github/workflows/plugin-check-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,47 +87,14 @@ jobs:
run: |
touch .wp-env.json
> .wp-env.json
echo "{ \"core\": $WP_VERSION, \"port\": 8880, \"testsPort\": 8881, \"plugins\": [ \"$PLUGIN_DIR\", \"https://downloads.wordpress.org/plugin/plugin-check.latest-stable.zip\", \"https://downloads.wordpress.org/plugin/glotpress.latest-stable.zip\" ] }" >> .wp-env.json
echo "{ \"core\": $WP_VERSION, \"port\": 8880, \"testsPort\": 8881, \"plugins\": [ \"https://downloads.wordpress.org/plugin/glotpress.latest-stable.zip\", \"$PLUGIN_DIR\", \"https://downloads.wordpress.org/plugin/plugin-check.latest-stable.zip\" ] }" >> .wp-env.json
npx wp plugin install https://downloads.wordpress.org/plugin/plugin-check.latest-stable.zip --activate
npx wp plugin install https://downloads.wordpress.org/plugin/glotpress.latest-stable.zip --activate
npx wp plugin install $PLUGIN_DIR --activate
npm -g --no-fund i @wordpress/env
wp-env start --update
shell: bash
env:
WP_VERSION: 'null'

- name: Run Plugin Check
run: |
CHECKS="${CHECKS//$'\n'/,}"
EXCLUDE_CHECKS="${EXCLUDE_CHECKS//$'\n'/,}"
CATEGORIES="${CATEGORIES//$'\n'/,}"
EXCLUDE_DIRS="${EXCLUDE_DIRS//$'\n'/,}"
ADDITIONAL_ARGS="$CHECKS $EXCLUDE_CHECKS $CATEGORIES $IGNORE_WARNINGS $IGNORE_ERRORS $INCLUDE_EXPERIMENTAL $EXCLUDE_DIRS"
# TODO: Install dependencies first, see https://github.com/wordpress/plugin-check-action/issues/66
# Get plugin dependencies
wp-env run cli wp plugin get $PLUGIN_SLUG --field=requires_plugins --format=json
wp-env run cli wp plugin activate $PLUGIN_SLUG
# Debugging information
wp-env run cli wp plugin list
wp-env run cli wp plugin list-checks
wp-env run cli wp plugin list-check-categories
# Run Plugin Check
wp-env run cli wp plugin check $PLUGIN_SLUG --format=json $ADDITIONAL_ARGS --require=./wp-content/plugins/plugin-check/cli.php > ${{ runner.temp }}/plugin-check-results.txt
shell: bash
env:
CHECKS: ''
EXCLUDE_CHECKS: ''
CATEGORIES: ''
EXCLUDE_DIRS: ''
IGNORE_WARNINGS: ''
IGNORE_ERRORS: ''
INCLUDE_EXPERIMENTAL: ''

- name: Process results
run: |
node ../../actions/plugin-check-action/dist/index.js ${{ runner.temp }}/plugin-check-results.txt
shell: bash
env:
INPUT_REPO_TOKEN: ${{ github.token }}
WP_VERSION: 'latest'

0 comments on commit 64c6127

Please sign in to comment.