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

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
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

- name: Run linter
run: pnpm lint

unit-test:
name: Unit Tests
runs-on: ubuntu-latest
needs: lint
permissions:
contents: read
steps:
- name: Checkout code
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

- name: Run unit tests
run: pnpm test run

- name: Generate coverage report
run: pnpm test:coverage run

- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 7

e2e-test:
name: E2E Tests
runs-on: ubuntu-latest
needs: unit-test
permissions:
contents: read

# Set environment variables for all test steps
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
TESTMAIL_API_KEY: ${{ secrets.TESTMAIL_API_KEY }}
TESTMAIL_NAMESPACE: ${{ secrets.TESTMAIL_NAMESPACE }} # e.g., "abcde"

steps:
- name: Checkout code
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

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Build Next.js App
run: pnpm build

- name: Run Playwright tests
run: pnpm test:e2e

- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7

# deploy-dev:
# name: Deploy to Development
# runs-on: ubuntu-latest
# needs: e2e-test
# if: github.ref == 'refs/heads/develop'
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Deploy to Vercel (or other provider)
# # Add your deployment steps here
# run: echo "Deploying to dev..."
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Playwright
/playwright-report/
/test-results/
/playwright/.auth/

# Test coverage
/coverage/
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,31 @@ Open [http://localhost:3000](http://localhost:3000) in your browser to see the r

---

## 🧪 Testing

WebDrop has comprehensive test coverage including unit tests and end-to-end tests.

### Running Tests

```bash
# Run unit tests
pnpm test

# Run E2E tests (requires build first)
pnpm build
pnpm test:e2e

# Run all tests
pnpm test:all

# Generate coverage report
pnpm test:coverage
```

For detailed testing documentation, see [TESTING.md](TESTING.md).

---

## ⚠️ File Size Limit

This application is designed to chunk files and send them peer-to-peer. The file chunks are re-assembled in the **receiver's browser memory (RAM)**.
Expand Down
Loading
Loading