New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] - NPM Dependency Caching and Lighthouse Audit Action #2957
Closed
adithyaakrishna
wants to merge
17
commits into
layer5io:master
from
adithyaakrishna:feat/adithyaakrishna/ci-npm-caching
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8011d4e
Added NPM Caching Capabilities to Action Scripts
5b286b3
Added Lighthouse Action
58b991d
Updated Lighthouse GH Action
fd97f94
Updated Steps Name
58b9d4c
Updated Lighthouse CI
cac4e8f
Seperated Ligthouse GH Action
7bdec95
Updated Lighthouse CI Script
e51e7ac
Updated Lighthouse CI Script for Needs
93ec61a
Removed Lighthouse CI Script Needs
a6b3c2d
Added PARALLEL_SOURCING Flag to Gatsby Config
6848f28
Updated Lighthouse CI Name
589ec72
Reverted Changes to Lighthouse CI Name
71681a4
Added Lighthouse CI Timeout
0b71ae1
Updated to Label Based Action Trigger
6962a9b
Updated Lighthouse CI Timeout
96f5f51
Made requested changes
62418fb
Merge branch 'master' into feat/adithyaakrishna/ci-npm-caching
leecalcote File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[ | ||
{ | ||
"path": "/*", | ||
"timings": [ | ||
{ | ||
"metric": "interactive", | ||
"budget": 10000 | ||
}, | ||
{ | ||
"metric": "first-meaningful-paint", | ||
"budget": 1500 | ||
} | ||
], | ||
"resourceSizes": [ | ||
{ | ||
"resourceType": "document", | ||
"budget": 18 | ||
}, | ||
{ | ||
"resourceType": "script", | ||
"budget": 125 | ||
}, | ||
{ | ||
"resourceType": "total", | ||
"budget": 750 | ||
} | ||
], | ||
"resourceCounts": [ | ||
{ | ||
"resourceType": "third-party", | ||
"budget": 10 | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
extends: 'lighthouse:default', | ||
url: 'https://layer5.io/', | ||
settings: { | ||
scores: { | ||
performance: 90, | ||
accessibility: 90, | ||
'best-practices': 90, | ||
seo: 80, | ||
}, | ||
// 'onlyCategories': [ | ||
// 'performance', | ||
// 'accessibility', | ||
// 'best-practices', | ||
// 'seo'` | ||
// ], | ||
// 'skipAudits': [ | ||
// 'byte-efficiency/uses-responsive-images', | ||
// 'byte-efficiency/uses-webp-images', | ||
// 'seo/meta-description' | ||
// ] | ||
}, | ||
ci: { | ||
collect: { | ||
settings: { | ||
emulatedFormFactor: 'desktop', | ||
plugins: ['lighthouse-plugin-field-performance'], | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
extends: 'lighthouse:default', | ||
url: 'https://layer5.io/', | ||
settings: { | ||
scores: { | ||
performance: 90, | ||
accessibility: 90, | ||
'best-practices': 90, | ||
seo: 80, | ||
}, | ||
// 'onlyCategories': [ | ||
// 'performance', | ||
// 'accessibility', | ||
// 'best-practices', | ||
// 'seo'` | ||
// ], | ||
// 'skipAudits': [ | ||
// 'byte-efficiency/uses-responsive-images', | ||
// 'byte-efficiency/uses-webp-images', | ||
// 'seo/meta-description' | ||
// ] | ||
}, | ||
ci: { | ||
collect: { | ||
settings: { | ||
emulatedFormFactor: 'mobile', | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Lighthouse CI | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
types: [ labeled ] | ||
|
||
jobs: | ||
lighthouse: | ||
if: ${{ github.event.label.name == 'lighthouse' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Wait for the Netlify Preview | ||
# https://github.com/JakePartusch/wait-for-netlify-action | ||
uses: jakepartusch/wait-for-netlify-action@v1.3 | ||
id: netlify | ||
with: | ||
max_timeout: 600 | ||
site_name: 'layer5' | ||
|
||
- name: Audit URLs using Lighthouse for desktop | ||
# https://github.com/treosh/lighthouse-ci-action | ||
uses: treosh/lighthouse-ci-action@v9 | ||
with: | ||
urls: ${{ steps.netlify.outputs.url }} | ||
budgetPath: ./.github/config/lighthouse-budget.json | ||
configPath: ./.github/config/lighthouse-config-desktop.json | ||
uploadArtifacts: true | ||
temporaryPublicStorage: true | ||
runs: 3 | ||
|
||
- name: Audit URLs using Lighthouse for mobile | ||
uses: treosh/lighthouse-ci-action@v9 | ||
with: | ||
urls: ${{ steps.netlify.outputs.url }} | ||
budgetPath: ./.github/config/lighthouse-budget.json | ||
configPath: ./.github/config/lighthouse-config-mobile.json | ||
uploadArtifacts: true | ||
temporaryPublicStorage: true | ||
runs: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ module.exports = { | |
twitterUsername: "@layer5", | ||
}, | ||
flags: { | ||
PARALLEL_SOURCING: true, | ||
FAST_DEV: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is enabled by default in gatsbyv4. Not needed |
||
PARALLEL_SOURCING: true | ||
}, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nikhil-Ladha is there any way using which we can share outputs from other workflows? I am a bit stuck on that here 😶
CC @Chadha93
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, but what output are you referring to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nikhil-Ladha Is there any way where we can extract the l5io bot output which comments the preview URL for the workflow here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the
find-comment
action, only if you have the PR number for which the workflow is running.Or, if that's not possible then another way is to save the deploy URL as an artifact in the
preview-site
workflow and then download that artifact here and get the URL from it.If the first one is feasible, then that is preferred.