Skip to content

Commit

Permalink
feat: improve tests performance
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipPyrek committed Jun 19, 2024
1 parent 1cdf1f2 commit 5a8dc83
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ module.exports = {
'@typescript-eslint/no-non-null-assertion': ['warn'],
'@typescript-eslint/consistent-type-imports': 'error'
}
},
{
files: ['*.tsx'],
parser: '@typescript-eslint/parser',
extends: ['plugin:@microsoft/eslint-plugin-sdl/typescript'],
plugins: ['@typescript-eslint', 'react-hooks'],
rules: {
'@typescript-eslint/no-implied-eval': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react/prop-types': ['off'],
'react/react-in-jsx-scope': 'off'
}
}
]
}
13 changes: 12 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
with:
fetch-depth: 0 # In order for commitlint to check historic commits

# Cache cdk context to optimize OpenNext builds
# https://docs.sst.dev/constructs/NextjsSite#nextjs-app-built-twice
- name: CDK Context cache
uses: actions/cache@v4
with:
path: cdk.context.json
key: ${{ runner.os }}-${{ github.ref_name == 'master' && 'master' || 'staging' }}-${{ hashFiles('./stacks/**') }}-${{ hashFiles('./constructs/**') }}-${{ hashFiles('sst.config.ts') }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
Expand Down Expand Up @@ -54,8 +62,11 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
- name: Build SST
run: pnpm sst build

- name: Type check
run: pnpm run ci:typecheck:all
run: pnpm run typecheck:all

- name: Test
run: pnpm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ yarn-error.log*

*.tsbuildinfo
node_modules
pnpm-exec-summary.json

# Coverage directory used by jest
coverage
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"test": "vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit",
"typecheck:all": "pnpm run env -- pnpm run ci:typecheck:all",
"ci:typecheck:all": "sst build && pnpm run typecheck && pnpm run -r typecheck"
"typecheck:all": "time pnpm run typecheck && time pnpm run -r --report-summary typecheck && cat pnpm-exec-summary.json"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": "eslint --fix",
Expand Down
5 changes: 4 additions & 1 deletion services/frontend/next.config.js

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

0 comments on commit 5a8dc83

Please sign in to comment.