From eb8ae0ab3e67010f3954d4f47e569224fc6a15f2 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 17 Aug 2025 19:09:06 +0530 Subject: [PATCH 1/9] Integrate lighthouseci --- .github/workflows/run-ci-cd.yaml | 30 ++++++++++++++++++++++++++++++ .gitignore | 1 + frontend/lighthouserc.json | 19 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 frontend/lighthouserc.json diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index 423b00ae0f..f8f96062a9 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -483,6 +483,36 @@ jobs: working-directory: .github/ansible run: ansible-playbook -i inventory.yaml staging/proxy.yaml -e "github_workspace=$GITHUB_WORKSPACE" + lighthouse_ci: + name: Run Lighthouse CI + needs: + # - deploy-staging-nest-proxy: + - pre-commit + + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + + - name: Install pnpm + uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda + with: + version: 10 + run_install: true + + - name: Set up Node + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: 22 + cache: 'pnpm' + cache-dependency-path: frontend/pnpm-lock.yaml + + - name: run Lighthouse CI + working-directory: frontend + run: | + pnpm install -g @lhci/cli@0.15.1 + lhci autorun + build-production-images: name: Build Production Images env: diff --git a/.gitignore b/.gitignore index 16476f0c7d..1379e1b8cd 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ __pycache__ .env* !.env.example .idea +.lighthouseci/ .local .mypy_cache .npm/ diff --git a/frontend/lighthouserc.json b/frontend/lighthouserc.json new file mode 100644 index 0000000000..479b2dbe99 --- /dev/null +++ b/frontend/lighthouserc.json @@ -0,0 +1,19 @@ +{ + "ci": { + "collect": { + "url": ["https://google.com"], + "numberOfRuns": 1 + }, + "upload": { + "target": "temporary-public-storage" + }, + "assert": { + "assertions": { + "categories:performance": ["warn", { "minScore": 0.9 }], + "categories:accessibility": ["warn", { "minScore": 0.9 }], + "categories:best-practices": ["warn", { "minScore": 0.9 }], + "categories:seo": ["warn", { "minScore": 0.9 }] + } + } + } +} From b6fcd6d5566fecf67f4c8e82194571c2c2c24402 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 17 Aug 2025 19:13:16 +0530 Subject: [PATCH 2/9] use nest.owasp.dev --- .github/workflows/run-ci-cd.yaml | 2 +- frontend/lighthouserc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index f8f96062a9..bb68242521 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -486,7 +486,7 @@ jobs: lighthouse_ci: name: Run Lighthouse CI needs: - # - deploy-staging-nest-proxy: + # - deploy-staging-nest-proxy: - pre-commit runs-on: ubuntu-latest diff --git a/frontend/lighthouserc.json b/frontend/lighthouserc.json index 479b2dbe99..0963ae6f9b 100644 --- a/frontend/lighthouserc.json +++ b/frontend/lighthouserc.json @@ -1,7 +1,7 @@ { "ci": { "collect": { - "url": ["https://google.com"], + "url": ["https://nest.owasp.dev"], "numberOfRuns": 1 }, "upload": { From 004cb080964a26d658971dbe8dbddd25a3b954cc Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 17 Aug 2025 19:15:27 +0530 Subject: [PATCH 3/9] run lighthouse after staging deployment --- .github/workflows/run-ci-cd.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index bb68242521..6a81ee58e1 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -486,8 +486,7 @@ jobs: lighthouse_ci: name: Run Lighthouse CI needs: - # - deploy-staging-nest-proxy: - - pre-commit + - deploy-staging-nest-proxy: runs-on: ubuntu-latest steps: @@ -512,6 +511,8 @@ jobs: run: | pnpm install -g @lhci/cli@0.15.1 lhci autorun + env: + LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} build-production-images: name: Build Production Images From 3fcf890de6a7e532be7365f3067bf8dd68094a37 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 17 Aug 2025 19:20:18 +0530 Subject: [PATCH 4/9] Update code --- .github/workflows/run-ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index 6a81ee58e1..1a6be638c3 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -486,7 +486,7 @@ jobs: lighthouse_ci: name: Run Lighthouse CI needs: - - deploy-staging-nest-proxy: + - deploy-staging-nest-proxy runs-on: ubuntu-latest steps: From 3871ddc234898d7dc3d288d3647958886cc5f88b Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 17 Aug 2025 22:27:10 +0530 Subject: [PATCH 5/9] Update code temporarily --- .github/workflows/run-ci-cd.yaml | 17 ++++------------- frontend/lighthouserc.json | 4 ++-- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index 1a6be638c3..5689afc806 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -485,32 +485,23 @@ jobs: lighthouse_ci: name: Run Lighthouse CI - needs: - - deploy-staging-nest-proxy + # needs: + # - deploy-staging-nest-proxy runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - - name: Install pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda - with: - version: 10 - run_install: true - - name: Set up Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: node-version: 22 - cache: 'pnpm' - cache-dependency-path: frontend/pnpm-lock.yaml - - name: run Lighthouse CI + - name: Run Lighthouse CI working-directory: frontend run: | - pnpm install -g @lhci/cli@0.15.1 - lhci autorun + npx -y @lhci/cli@0.15.1 autorun env: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} diff --git a/frontend/lighthouserc.json b/frontend/lighthouserc.json index 0963ae6f9b..62f6425c6f 100644 --- a/frontend/lighthouserc.json +++ b/frontend/lighthouserc.json @@ -1,8 +1,8 @@ { "ci": { "collect": { - "url": ["https://nest.owasp.dev"], - "numberOfRuns": 1 + "url": ["https://nest.owasp.dev/"], + "numberOfRuns": 3 }, "upload": { "target": "temporary-public-storage" From b7ddd18c3f405a7580717e0a073f5d18b782acfc Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 17 Aug 2025 22:30:26 +0530 Subject: [PATCH 6/9] run lighthouse after staging deployment --- .github/workflows/run-ci-cd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index 5689afc806..c28b9a8090 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -485,8 +485,8 @@ jobs: lighthouse_ci: name: Run Lighthouse CI - # needs: - # - deploy-staging-nest-proxy + needs: + - deploy-staging-nest-proxy runs-on: ubuntu-latest steps: From 8ad39f8f6967ffa9d71c882ccb56c1ad03a6111a Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Tue, 19 Aug 2025 23:40:48 +0530 Subject: [PATCH 7/9] remove github app environment variable and test --- .github/workflows/run-ci-cd.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index c28b9a8090..ee7af75408 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -485,8 +485,8 @@ jobs: lighthouse_ci: name: Run Lighthouse CI - needs: - - deploy-staging-nest-proxy + # needs: + # - deploy-staging-nest-proxy runs-on: ubuntu-latest steps: @@ -502,8 +502,6 @@ jobs: working-directory: frontend run: | npx -y @lhci/cli@0.15.1 autorun - env: - LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} build-production-images: name: Build Production Images From 4fe400645c392c34bd908e9043a460fe7d60579c Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Tue, 19 Aug 2025 23:41:53 +0530 Subject: [PATCH 8/9] run lighthouse after staging deployment --- .github/workflows/run-ci-cd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index ee7af75408..c8f1fc2178 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -485,8 +485,8 @@ jobs: lighthouse_ci: name: Run Lighthouse CI - # needs: - # - deploy-staging-nest-proxy + needs: + - deploy-staging-nest-proxy runs-on: ubuntu-latest steps: From 266aeb78df38ae98a962ce17508a279f6071d934 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Tue, 19 Aug 2025 18:56:58 -0700 Subject: [PATCH 9/9] Update code --- .github/workflows/run-ci-cd.yaml | 3 +-- cspell/custom-dict.txt | 1 + frontend/Makefile | 3 +++ frontend/lighthouserc.json | 14 +++++++------- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-ci-cd.yaml b/.github/workflows/run-ci-cd.yaml index c8f1fc2178..6cd9ffae65 100644 --- a/.github/workflows/run-ci-cd.yaml +++ b/.github/workflows/run-ci-cd.yaml @@ -483,11 +483,10 @@ jobs: working-directory: .github/ansible run: ansible-playbook -i inventory.yaml staging/proxy.yaml -e "github_workspace=$GITHUB_WORKSPACE" - lighthouse_ci: + run-lighthouse-ci: name: Run Lighthouse CI needs: - deploy-staging-nest-proxy - runs-on: ubuntu-latest steps: - name: Check out repository diff --git a/cspell/custom-dict.txt b/cspell/custom-dict.txt index c1ee6544e9..67fff0523a 100644 --- a/cspell/custom-dict.txt +++ b/cspell/custom-dict.txt @@ -69,6 +69,7 @@ inlinehilite isanori jumpstart kasya +lhci libexpat linkify lte diff --git a/frontend/Makefile b/frontend/Makefile index 2da6f15e68..3668c49314 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -27,6 +27,9 @@ format-frontend-code: || (printf "pnpm run format"; for i in $$(seq 1 58); do printf "."; done; printf "\033[37;41mFailed\033[0m\n" \ && pnpm run format)) +lighthouse-ci: + @cd frontend && npx -y @lhci/cli@0.15.1 autorun --collect.url=http://localhost:3000 + lint-frontend-code: @(cd frontend && pnpm run lint:check >/dev/null 2>&1 \ && (printf "pnpm run lint"; for i in $$(seq 1 60); do printf "."; done; printf "\033[30;42mPassed\033[0m\n") \ diff --git a/frontend/lighthouserc.json b/frontend/lighthouserc.json index 62f6425c6f..19ce9611d1 100644 --- a/frontend/lighthouserc.json +++ b/frontend/lighthouserc.json @@ -1,12 +1,5 @@ { "ci": { - "collect": { - "url": ["https://nest.owasp.dev/"], - "numberOfRuns": 3 - }, - "upload": { - "target": "temporary-public-storage" - }, "assert": { "assertions": { "categories:performance": ["warn", { "minScore": 0.9 }], @@ -14,6 +7,13 @@ "categories:best-practices": ["warn", { "minScore": 0.9 }], "categories:seo": ["warn", { "minScore": 0.9 }] } + }, + "collect": { + "url": ["https://nest.owasp.dev/"], + "numberOfRuns": 3 + }, + "upload": { + "target": "temporary-public-storage" } } }