Skip to content

Commit

Permalink
๐Ÿ›Fix: depsource cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen1264 committed Dec 16, 2024
1 parent dad7de9 commit 81be3e3
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 34 deletions.
13 changes: 9 additions & 4 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
version = 1

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

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

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

[analyzers.meta]
env = ["nodejs"]
[[transformers]]
name = "prettier"
enabled = true
52 changes: 24 additions & 28 deletions .github/workflows/deepsource.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
name: Deepsource Code Review
name: DeepSource Code Review

on:
pull_request:
branches:
- main
- develop
types: [opened, synchronize]

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

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Install dependencies
run: npm ci

- name: Run Lint
- name: Run linter
run: npm run lint

- name: Run Deepsource CLI
env:
DEEPSOURCE_TOKEN: ${{ secrets.DEEPSOURCE_TOKEN }}
run: |
# Deepsource CLI ์„ค์น˜
curl https://deepsource.io/cli | sh
# Lint ๋ถ„์„ ์‹คํ–‰
./bin/deepsource report --analyzer lint \
--key typescript \
--value "$(cat lint-report.json)"
# ํ•„์š”ํ•œ ๊ฒฝ์šฐ ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ ์ถ”๊ฐ€
# - name: Run Tests with Coverage
# run: npm run test:coverage
- 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 }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

*storybook.log
# storybook
*storybook.log
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 81be3e3

Please sign in to comment.