Skip to content

Commit

Permalink
Merge pull request #4405 from randychilau/lhci-warn
Browse files Browse the repository at this point in the history
[LHCI] Proposal to move audit tests to use categories in “warn” mode
  • Loading branch information
Nikhil-Ladha committed Jun 30, 2023
2 parents aaec2a8 + 4db1c23 commit 7029d48
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lighthouseci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
with:
node-version: 19
- run: npm install && npm install -g @lhci/[email protected]
- run: npm run build
- run: CI=false npm run build
- run: lhci autorun
47 changes: 25 additions & 22 deletions .lighthouserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@ module.exports = {
"ci": {
"collect": {
"staticDistDir": "./public",
"url" : ["http://localhost/404.html",
"http://localhost/index.html",
"http://localhost/404/index.html",
"http://localhost/company/about.html" ,
"http://localhost/cloud-native-management/meshery.html",
"http://localhost/cloud-native-management/meshmap.html",
"http://localhost/learn/learning-paths.html",
"http://localhost/learn/service-mesh-books.html",
"http://localhost/learn/service-mesh-workshops.html",
"http://localhost/learn.html",
"http://localhost/blog.html",
"http://localhost/resources.html",
"http://localhost/careers.html",
"http://localhost/community/members.html",
"http://localhost/community/meshmates.html",
"http://localhost/community/events.html",
"http://localhost/community/newcomers.html",],
"url" : [
"http://localhost/404.html",
"http://localhost/404/index.html",
"http://localhost",
"http://localhost/company/about/index.html",
"http://localhost/cloud-native-management/meshery/index.html",
"http://localhost/cloud-native-management/meshmap/index.html",
"http://localhost/learn/learning-paths/index.html",
"http://localhost/learn/service-mesh-books/index.html",
"http://localhost/learn/service-mesh-workshops/index.html",
"http://localhost/learn/index.html",
"http://localhost/blog/index.html",
"http://localhost/resources/index.html",
"http://localhost/careers/index.html",
"http://localhost/community/members/index.html",
"http://localhost/community/meshmates/index.html",
"http://localhost/community/events/index.html",
"http://localhost/community/newcomers/index.html",
],
},
"assert": {
"preset": "lighthouse:no-pwa",
"assertions": {
"csp-xss": "off",
"aria-hidden-focus": "off"
}
},
"categories:performance": ["warn", {"minScore": .90}],
"categories:accessibility": ["warn", {"minScore": .90}],
"categories:best-practices": ["warn", {"minScore": .90}],
"categories:seo": ["warn", {"minScore": .90}],
}
},
"upload": {
"target": "temporary-public-storage",
},
Expand Down
4 changes: 2 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { paginate } = require("gatsby-awesome-pagination");
const { createFilePath } = require("gatsby-source-filesystem");
const config = require("./gatsby-config");

if (process.env.CI) {
if (process.env.CI === "true") {
// All process.env.CI conditionals in this file are in place for GitHub Pages, if webhost changes in the future, code may need to be modified or removed.
//Replacing '/' would result in empty string which is invalid
const replacePath = (url) => (url === "/" || url.includes("/404")) ? url : `${url}.html`;
Expand Down Expand Up @@ -69,7 +69,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
const { createPage } = actions;

const envCreatePage = (props) => {
if (process.env.CI){
if (process.env.CI === "true"){
const { path, ...rest } = props;

createRedirect({ fromPath: `/${path}/`, toPath: `/${path}`, redirectInBrowser: true, isPermanent: true });
Expand Down

0 comments on commit 7029d48

Please sign in to comment.