From 6349cc6f484f48fda27943a5f36987b3ce1a8798 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 5 Feb 2024 03:17:28 +0900 Subject: [PATCH] ci(lighthouse): only for suspensive.org (#695) # Overview ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/suspensive/react/blob/main/CONTRIBUTING.md) 2. I added documents and tests. --- .github/workflows/ci.yml | 19 ++++++++++++++----- .lighthouserc.cjs | 5 +++-- websites/visualization/tsconfig.json | 12 ++++++------ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8e6dbae0..4d965933e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - command: ['lint', 'lint:attw', 'lint:monorepo', 'lint:pub', 'test', 'test:production', 'type:check', 'build'] + command: + [ + 'lint', + 'lint:attw', + 'lint:monorepo', + 'lint:pub', + 'test', + 'test:production', + 'type:check', + 'build', + 'ci:lighthouse', + ] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/pnpm-setup-node @@ -28,11 +39,9 @@ jobs: - if: matrix.command == 'test' run: pnpm playwright install - run: pnpm ${{ matrix.command }} + env: + LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} - if: matrix.command == 'test' uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - if: matrix.command == 'build' - run: pnpm ci:lighthouse - env: - LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} diff --git a/.lighthouserc.cjs b/.lighthouserc.cjs index 3a6067b1b..8d4bf4ac2 100644 --- a/.lighthouserc.cjs +++ b/.lighthouserc.cjs @@ -1,8 +1,9 @@ module.exports = { ci: { collect: { - url: ['http://localhost:4000/', 'http://localhost:4001/', 'http://localhost:4100/'], - startServerCommand: 'pnpm start', + url: ['http://localhost:4001/', 'http://localhost:4001/docs/why/'], + startServerCommand: 'pnpm start --filter=@suspensive/suspensive.org', + numberOfRuns: 2, }, upload: { target: 'temporary-public-storage', diff --git a/websites/visualization/tsconfig.json b/websites/visualization/tsconfig.json index 6713e1fbc..66a9f78a5 100644 --- a/websites/visualization/tsconfig.json +++ b/websites/visualization/tsconfig.json @@ -16,13 +16,13 @@ "incremental": true, "plugins": [ { - "name": "next" - } + "name": "next", + }, ], "paths": { - "~/*": ["./src/*"] - } + "~/*": ["./src/*"], + }, }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "./.eslintrc.cjs"], - "exclude": ["node_modules", ".next"] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "./.eslintrc.cjs", "next.config.js"], + "exclude": ["node_modules", ".next"], }