Skip to content

Commit

Permalink
⚡feature: setting deepsource
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen1264 committed Dec 16, 2024
1 parent e6b5d46 commit ff1200f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version = 1

[[analyzers]]
name = "javascript"
enabled = true

[analyzers.meta]
environment = ["nodejs"]
style_guide = "airbnb"

[[analyzers]]
name = "test-coverage"
enabled = true

[[transformers]]
name = "prettier"
enabled = true
40 changes: 40 additions & 0 deletions .github/workflows/deepsource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: DeepSource Code Review

on:
pull_request:
types: [opened, synchronize]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Run tests and generate coverage
run: npm test -- --coverage

- name: Upload coverage to DeepSource
uses: deepsourcelabs/test-coverage-action@master
with:
key: javascript
coverage-file: ./coverage/lcov.info
dsn: ${{ secrets.DEEPSOURCE_DSN }}

- name: DeepSource Analyze
uses: deepsourcelabs/analyze-action@v1
with:
dsn: ${{ secrets.DEEPSOURCE_DSN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

*storybook.log
*storybook.log

# testing
/coverage
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
collectCoverage: true,
coverageReporters: ['lcov', 'text'],
coverageDirectory: 'coverage',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"prepare": "husky",
"postinstall": "husky install",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"build-storybook": "storybook build",
"test": "jest --coverage"
},
"dependencies": {
"@tanstack/react-query": "^5.59.14",
Expand Down

0 comments on commit ff1200f

Please sign in to comment.