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
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches:
- main
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

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

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests with coverage
run: pnpm test -- --watch=false --coverage
env:
CI: true

- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 30
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.PHONY: test test-watch test-coverage test-file lint lint-fix help

# Run all tests once (CI mode)
test:
CI=1 npm test -- --watch=false

# Run tests in watch mode (interactive development)
test-watch:
npm test

# Run tests with coverage report
test-coverage:
CI=1 npm test -- --coverage --watch=false

# Run a specific test file
# Usage: make test-file FILE=src/utils/__tests__/retry-with-fallback.test.js
test-file:
@if [ -z "$(FILE)" ]; then \
echo "Error: FILE parameter is required"; \
echo "Usage: make test-file FILE=src/utils/__tests__/retry-with-fallback.test.js"; \
exit 1; \
fi
CI=1 npm test -- --watch=false --testPathPattern="$(FILE)"

# Run ESLint
lint:
npm run lint

# Auto-fix ESLint issues
lint-fix:
npm run lint:fix

# Show available commands
help:
@echo "Available make commands:"
@echo " make test - Run all tests once (CI mode)"
@echo " make test-watch - Run tests in watch mode (interactive)"
@echo " make test-coverage - Run tests with coverage report"
@echo " make test-file FILE=<path> - Run specific test file"
@echo " make lint - Run ESLint"
@echo " make lint-fix - Auto-fix ESLint issues"
@echo " make help - Show this help message"
Loading