Skip to content

Commit

Permalink
Try 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 872df72
Showing 1 changed file with 9 additions and 46 deletions.
55 changes: 9 additions & 46 deletions .github/workflows/plugin-check-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,51 +83,14 @@ jobs:
env:
BUILD_DIR: 'gp-toolbox'

- name: Setup wp-env
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
npm -g --no-fund i @wordpress/env
wp-env start --update
shell: bash
env:
WP_VERSION: 'null'
- name: Start wp-env
run: |
touch .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-env start
- name: Run Plugin Check
- name: Install and activate plugins in order
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 }}
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

0 comments on commit 872df72

Please sign in to comment.