Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version: "2"
checks:
argument-count:
enabled: true
config:
threshold: 4
complex-logic:
enabled: true
config:
threshold: 4
file-lines:
enabled: true
config:
threshold: 250 # Maximum lines per file
method-complexity:
enabled: true
config:
threshold: 5 # Cyclomatic complexity threshold
method-count:
enabled: true
config:
threshold: 20 # Maximum methods per class/module
method-lines:
enabled: true
config:
threshold: 25 # Maximum lines per method
nested-control-flow:
enabled: true
config:
threshold: 4 # Maximum nesting depth
return-statements:
enabled: true
config:
threshold: 4 # Maximum return statements per function
similar-code:
enabled: true
identical-code:
enabled: true

exclude_patterns:
- "test/"
- "tests/"
- "**/test/"
- "**/tests/"
- "**/*.test.js"
- "**/*.test.jsx"
- "**/*.spec.js"
- "**/*.spec.jsx"
- "build/"
- "dist/"
- "node_modules/"
- "public/"
- "coverage/"
- "docs/"
- "*.md"
- ".github/"
-
54 changes: 54 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Description
<!--A brief explanation of what was changed, why it was changed and how it was changed. -->

## Type of change
<!-- Mark relevant items with 'x' -->
- [ ] New Feature
- [ ] Bug Fix
- [ ] Refactor
- [ ] Documentation Update
- [ ] Style
- [ ] Performance Improvements
- [ ] Test Update
- [ ] Build/CI Update

## Testing
<!-- Describe how you tested these changes -->
- [ ] Unit Tests Added/Updated
- [ ] Integration Tests Added/Updated
- [ ] Manual Testing Completed
### Test Cases
<!-- List key test scenarios -->
1.
2.

## Deployment Instructions (optional)
<!-- Include instructions about any scripts that need to be run -->

## QA Instructions (optional)
<!-- Include any information that will help a reviewer with testing -->

## Breaking Changes
<!-- Mark with 'x' if applies -->
- [ ] This PR introduces breaking changes
<!-- If yes, describe the impact and migration path -->

## Dependencies
<!-- List any new dependencies or changes to existing ones -->

## Related Tickets & Documents
<!-- Include JIRA ticket references and their summary -->

## Screenshots/Recordings
<!-- If applicable, add screenshots or recordings -->

## Checklist
<!-- Mark completed items with 'x' -->
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Tests pass locally
- [ ] Documentation updated
- [ ] No new warnings generated

## Additional Notes
<!-- Any other relevant information -->
73 changes: 73 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Continuous Integration Pipeline

on:
push:
paths-ignore:
- '**.md'
- '**.txt'
- '**.xml'
- '**.sql'
- '**.csv'
- '**.zip'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I added - AFAIK you don't need separate definition for pull_request because it's covered under push

on:
  push:
    paths-ignore:
      - '**.md'
      - '**.txt'
      - '**.json'
      - '**.yml'
      - '**.properties'
      - '**.xml'
      - '**.sql'
      - '**.csv'
      - '**.zip'
      - 'docs/**'
      - '.gitignore'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense, let me resolve that


env:
NODE_VERSION: '16'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Run tests with coverage
run: |
mkdir -p coverage
mkdir -p coverage/.tmp
npm run test:coverage
echo "Test coverage complete, checking files:"
ls -la
echo "Coverage directory contents:"
ls -la coverage/ || echo "Coverage directory empty or not found"

- name: Setup Code Climate
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build

- name: Run Code Climate Analysis
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
COVERAGE_FILE=$(find . -type f -name "lcov.info" -not -path "./node_modules/*" 2>/dev/null || echo "")
if [ -n "$COVERAGE_FILE" ]; then
echo "Found coverage file at: $COVERAGE_FILE"
./cc-test-reporter format-coverage "$COVERAGE_FILE" --input-type lcov
./cc-test-reporter upload-coverage
else
echo "Error: lcov.info not found in project directory (excluding node_modules)"
echo "Current directory structure:"
ls -R
exit 1
fi
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ node_modules/.cache
node_modules/
build/
# End of https://www.gitignore.io/api/visualstudiocode
/nbproject/private/
/nbproject/private/
coverage/
/coverage/
Loading