Skip to content

Commit

Permalink
Add advanced example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Nov 1, 2023
1 parent 8981788 commit 212865e
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,39 @@ Results are posted as file annotations.

## Usage

### Basic Example

The simplest way to get up and running with your plugin.

Add a workflow (`.github/workflows/build-test.yml`):

```yaml
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run plugin check
uses: swissspidy/wp-plugin-check-action@v1
```
### Advanced Usage
The basic example above covers many use cases, but sometimes plugins can be a bit more
complex and involve some sort of build process.
Also, if you already use tools like PHPCS, you might want to use the PHPCS-based checks
from Plugin Check but focus on the ones that are more useful for you.
```yaml
name: 'build-test'
on: # rebuild any PRs and main branch changes
Expand All @@ -29,10 +60,20 @@ jobs:
uses: actions/checkout@v3

# Here's where you would run your custom build process
# and configure & start the server environment.
# ...
# ...

- name: Build plugin
run: npm run build

- name: Run plugin check
uses: swissspidy/wp-plugin-check-action@main
uses: swissspidy/wp-plugin-check-action@v1
with:
build-dir: './my-awesome-plugin'
exclude-directories: 'prefixed_vendor_dir,another_dir_to_ignore'
categories: |
performance
accessibility
```
### Inputs
Expand Down

0 comments on commit 212865e

Please sign in to comment.