diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 900dcf3..53dafce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,13 +18,13 @@ jobs: mkdir build/ mv hello.php build/ - - name: Run plugin check + - name: Run plugin check (default) uses: ./ continue-on-error: true # Since we expect it to always fail for the test plugin. with: build-dir: 'build' - - name: Run plugin check + - name: Run plugin check (exclude checks) uses: ./ continue-on-error: true # Since we expect it to always fail for the test plugin. with: @@ -33,3 +33,10 @@ jobs: late_escaping plugin_readme include-experimental: true + + - name: Run plugin check (trunk) + uses: ./ + continue-on-error: true # Since we expect it to always fail for the test plugin. + with: + build-dir: 'build' + wp-version: 'trunk' diff --git a/README.md b/README.md index a01e632..a12fcf8 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,11 @@ See [action.yml](action.yml) # # Default: true include-experimental: '' + + # WordPress version to use. Supports "latest" or "trunk". + # + # Default: latest + wp-version: '' ``` ### Basic diff --git a/action.yml b/action.yml index 0990b15..b0d75bb 100644 --- a/action.yml +++ b/action.yml @@ -41,6 +41,10 @@ inputs: description: 'Include experimental checks' required: false default: 'false' + wp-version: + description: 'WordPress version to use' + required: false + default: 'latest' runs: using: "composite" steps: @@ -84,11 +88,13 @@ runs: run: | touch .wp-env.json > .wp-env.json - echo "{ \"core\": null, \"port\": 8880, \"testsPort\": 8881, \"plugins\": [ \"$PLUGIN_DIR\", \"plugin-check\" ] }" >> .wp-env.json + echo "{ \"core\": $WP_VERSION, \"port\": 8880, \"testsPort\": 8881, \"plugins\": [ \"$PLUGIN_DIR\", \"https://downloads.wordpress.org/plugin/plugin-check.1.0.0.zip\" ] }" >> .wp-env.json - npm -g i @wordpress/env + npm -g --no-fund i @wordpress/env wp-env start --update shell: bash + env: + WP_VERSION: ${{ inputs.wp-version == 'trunk' && '"WordPress/WordPress#master"' || 'null' }} - name: Run Plugin Check run: |