Skip to content

Commit

Permalink
Merge pull request #61 from treosh/feature/output-manifest
Browse files Browse the repository at this point in the history
Add fileSystemStoragePath
  • Loading branch information
alekseykulikov authored Jul 10, 2020
2 parents 43dfcaa + 80bf38f commit eacd103
Show file tree
Hide file tree
Showing 32 changed files with 16,496 additions and 21 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/LHCI-output-webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Example of output usage
name: LHCI-output-webhook
on: push
jobs:
output-webhook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use output for sending data to API.
id: LHCIAction
uses: ./
with:
urls: |
https://treo.sh/
- name: Webhook
uses: denar90/[email protected]
with:
webhookUrl: ${{secrets.ACTION_WEBHOOK_URL}}
data: '{ "links": ${{steps.LHCIAction.outputs.links}}, "manifest": ${{steps.LHCIAction.outputs.manifest}} }'
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,37 @@ Add a plugin as a dependency, so it's installed locally:

</details>

<details>
<summary>Use `output` for a powerful composition with other actions</summary><br>

#### main.yml

```yml
# Example of output usage
name: LHCI-output-webhook
on: push
jobs:
output-webhook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use output for sending data to API.
id: LHCIAction
uses: ./
with:
urls: |
https://treo.sh/
- name: Webhook
uses: denar90/[email protected]
with:
webhookUrl: ${{secrets.ACTION_WEBHOOK_URL}}
data: '{ "links": ${{steps.LHCIAction.outputs.links}}, "manifest": ${{steps.LHCIAction.outputs.manifest}} }'
```

[⚙️ See this workflow in use](https://github.com/treosh/lighthouse-ci-action/actions?workflow=LHCI-output-webhook)

</details>

Explore more workflows in [public examples](./.github/workflows).
Submit a pull request with a new one if they don't cover your use case.

Expand Down Expand Up @@ -473,6 +504,69 @@ serverToken: ${{ secrets.LHCI_SERVER_TOKEN }}

> **Note**: Use [Github secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets) to keep your token hidden!

## Outputs

### `resultsPath`

Server path to results stored results.

Example

```
/Users/lighthouse-ci-action/.lighthouseci
```
### `links`
Stored results links.
Example:
```js
{
'https://treo.sh/': 'https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1593981455963-59854.report.html'
...
}
```

### `assertionResults`

```js
;[
{
name: 'maxNumericValue',
expected: 61440,
actual: 508455,
values: [508455],
operator: '<=',
passed: false,
auditProperty: 'total.size',
auditId: 'resource-summary',
level: 'error',
url: 'https://treo.sh/',
auditTitle: 'Keep request counts low and transfer sizes small',
auditDocumentationLink: 'https://developers.google.com/web/tools/lighthouse/audits/budgets',
},
...
]
```

### `manifest`

Report results. Lighthouse-CI doc [reference](https://github.com/GoogleChrome/lighthouse-ci/blob/master/docs/configuration.md#outputdir).

```js
;[
{
url: 'https://treo.sh/',
isRepresentativeRun: true,
htmlPath: '/Users/lighthouse-ci-action/.lighthouseci/treo_sh-_-2020_07_05_20_37_18.report.html',
jsonPath: '/Users/lighthouse-ci-action/.lighthouseci/treo_sh-_-2020_07_05_20_37_18.report.json',
summary: { performance: 0.99, accessibility: 0.98, 'best-practices': 1, seo: 0.96, pwa: 0.71 },
},
]
```

---

## Credits
Expand Down
19 changes: 19 additions & 0 deletions node_modules/@lhci/cli/node_modules/@lhci/utils/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eacd103

Please sign in to comment.