Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Nov 1, 2023
1 parent 08855ff commit a9fb029
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ Results are posted as comments to pull requests and as [GitHub Action job summar

It collects data from the `Server-Timing` header and runs Lighthouse on a given set of URLs.

![Screenshot of a GitHub Action job summary output by this action](https://i.imgur.com/NONeYNq.png)
<img width="1154" alt="Screenshot of a GitHub Action job summary output by this action" src="https://github.com/swissspidy/wp-performance-action/assets/841956/bb543ba2-a142-49d5-bb45-77d11f121824">

## Usage

### Basic Example

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

```yaml
Expand All @@ -36,16 +38,36 @@ jobs:
- name: Install dependencies
run: npm ci

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

- name: Start server
run: npx wp-env start
# Here's where you would install dependencies, run your custom build process, etc.

- name: Run performance tests
uses: swissspidy/wp-performance-action@main
with:
plugins: |
./my-awesome-plugin
urls: |
http://localhost:8889/
http://localhost:8889/?p=1
```
### Advanced Example
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:

- name: Run performance tests
uses: ./
with:
urls: |
/
/sample/page/
plugins: |
./my-awesome-plugin
https://downloads.wordpress.org/plugin/performant-translations.zip
https://downloads.wordpress.org/plugin/wordpress-seo.zip
iterations: 5
repetitions: 1
```

0 comments on commit a9fb029

Please sign in to comment.