Skip to content

Commit a9fb029

Browse files
committed
Update readme
1 parent 08855ff commit a9fb029

1 file changed

Lines changed: 28 additions & 6 deletions

File tree

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ Results are posted as comments to pull requests and as [GitHub Action job summar
66

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

9-
![Screenshot of a GitHub Action job summary output by this action](https://i.imgur.com/NONeYNq.png)
9+
<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">
1010

1111
## Usage
1212

13+
### Basic Example
14+
1315
Add a workflow (`.github/workflows/build-test.yml`):
1416

1517
```yaml
@@ -36,16 +38,36 @@ jobs:
3638
- name: Install dependencies
3739
run: npm ci
3840

39-
# Here's where you would run your custom build process
40-
# and configure & start the server environment.
41-
42-
- name: Start server
43-
run: npx wp-env start
41+
# Here's where you would install dependencies, run your custom build process, etc.
4442

4543
- name: Run performance tests
4644
uses: swissspidy/wp-performance-action@main
4745
with:
46+
plugins: |
47+
./my-awesome-plugin
4848
urls: |
4949
http://localhost:8889/
5050
http://localhost:8889/?p=1
5151
```
52+
53+
### Advanced Example
54+
55+
```yaml
56+
jobs:
57+
test:
58+
runs-on: ubuntu-latest
59+
steps:
60+
61+
- name: Run performance tests
62+
uses: ./
63+
with:
64+
urls: |
65+
/
66+
/sample/page/
67+
plugins: |
68+
./my-awesome-plugin
69+
https://downloads.wordpress.org/plugin/performant-translations.zip
70+
https://downloads.wordpress.org/plugin/wordpress-seo.zip
71+
iterations: 5
72+
repetitions: 1
73+
```

0 commit comments

Comments
 (0)