chore: consolidate npm to bun in CI workflows #36
@@ -28,7 +28,7 @@ jobs:
|
|||||||
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: bun test src/__tests__/unit/ src/__tests__/*.test.tsx src/__tests__/auth-simple.test.ts
|
run: bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts
|
||||||
|
|
||||||
e2e-tests:
|
e2e-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
||||||
|
|
||||||
- name: Run E2E tests
|
- name: Run E2E tests
|
||||||
run: npm run test:acceptance:cucumber:prod
|
run: bun run test:acceptance:cucumber:prod
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgresql://euchre_camp:${{ secrets.DB_PASSWORD }}@dhg.lol:5432/euchre_camp_dev
|
DATABASE_URL: postgresql://euchre_camp:${{ secrets.DB_PASSWORD }}@dhg.lol:5432/euchre_camp_dev
|
||||||
DATABASE_PROVIDER: postgresql
|
DATABASE_PROVIDER: postgresql
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ jobs:
|
|||||||
docker run --rm \
|
docker run --rm \
|
||||||
-e DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" \
|
-e DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" \
|
||||||
${{ env.IMAGE_NAME }}-test:${{ steps.version.outputs.new_version }} \
|
${{ env.IMAGE_NAME }}-test:${{ steps.version.outputs.new_version }} \
|
||||||
bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts'
|
bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts
|
||||||
|
|
||||||
- name: Build production image
|
- name: Build production image
|
||||||
if: steps.commit.outputs.committed == 'true'
|
if: steps.commit.outputs.committed == 'true'
|
||||||
|
|||||||
@@ -29,21 +29,21 @@ DATABASE_URL := env_var_or_default("DATABASE_URL", "")
|
|||||||
# Install dependencies and setup environment
|
# Install dependencies and setup environment
|
||||||
setup:
|
setup:
|
||||||
@echo "Installing dependencies..."
|
@echo "Installing dependencies..."
|
||||||
npm install
|
bun install
|
||||||
@echo "Setting up database..."
|
@echo "Setting up database..."
|
||||||
npm run db:setup-dev
|
bun run db:setup-dev
|
||||||
@echo "Generating Prisma client..."
|
@echo "Generating Prisma client..."
|
||||||
npx prisma generate
|
bun x prisma generate
|
||||||
|
|
||||||
# --- Development ---
|
# --- Development ---
|
||||||
|
|
||||||
# Start the development server
|
# Start the development server
|
||||||
dev:
|
dev:
|
||||||
npm run dev
|
bun run dev
|
||||||
|
|
||||||
# Lint the codebase
|
# Lint the codebase
|
||||||
lint:
|
lint:
|
||||||
npm run lint
|
bun run lint
|
||||||
|
|
||||||
# Type check the codebase
|
# Type check the codebase
|
||||||
typecheck:
|
typecheck:
|
||||||
@@ -60,19 +60,19 @@ test: test-unit test-acceptance
|
|||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
test-unit:
|
test-unit:
|
||||||
npm run test:run
|
DATABASE_URL="postgresql://test:test@localhost:5432/test" bun test src/__tests__/unit/
|
||||||
|
|
||||||
# Run acceptance tests (Playwright)
|
# Run acceptance tests (Playwright)
|
||||||
test-acceptance:
|
test-acceptance:
|
||||||
@echo "Running acceptance tests..."
|
@echo "Running acceptance tests..."
|
||||||
npm run test:acceptance
|
bun x playwright test e2e/
|
||||||
|
|
||||||
# Run Cucumber e2e tests
|
# Run Cucumber e2e tests
|
||||||
test-cucumber:
|
test-cucumber:
|
||||||
@echo "Clearing Next.js cache..."
|
@echo "Clearing Next.js cache..."
|
||||||
rm -rf .next/
|
rm -rf .next/
|
||||||
@echo "Running Cucumber e2e tests..."
|
@echo "Running Cucumber e2e tests..."
|
||||||
npm run test:acceptance:cucumber
|
bun run test:acceptance:cucumber
|
||||||
|
|
||||||
# Run Cucumber e2e tests against production build
|
# Run Cucumber e2e tests against production build
|
||||||
test-cucumber-prod:
|
test-cucumber-prod:
|
||||||
@@ -86,18 +86,18 @@ test-cucumber-prod:
|
|||||||
@echo "Waiting for server to be ready..."
|
@echo "Waiting for server to be ready..."
|
||||||
sleep 15
|
sleep 15
|
||||||
@echo "Running Cucumber e2e tests against production build..."
|
@echo "Running Cucumber e2e tests against production build..."
|
||||||
npm run test:acceptance:cucumber || true
|
bun run test:acceptance:cucumber || true
|
||||||
@echo "Stopping production server..."
|
@echo "Stopping production server..."
|
||||||
kill $$SERVER_PID 2>/dev/null || true
|
kill $$SERVER_PID 2>/dev/null || true
|
||||||
@echo "Tests completed."
|
@echo "Tests completed."
|
||||||
|
|
||||||
# Run database migrations (Prisma)
|
# Run database migrations (Prisma)
|
||||||
migrate:
|
migrate:
|
||||||
npx prisma migrate dev
|
bun x prisma migrate dev
|
||||||
|
|
||||||
# Seed the database
|
# Seed the database
|
||||||
seed:
|
seed:
|
||||||
npm run db:seed
|
bun run scripts/seed.js
|
||||||
|
|
||||||
# --- Docker ---
|
# --- Docker ---
|
||||||
|
|
||||||
@@ -181,23 +181,23 @@ clean:
|
|||||||
|
|
||||||
# Generate Prisma client
|
# Generate Prisma client
|
||||||
prisma-generate:
|
prisma-generate:
|
||||||
npx prisma generate
|
bun x prisma generate
|
||||||
|
|
||||||
# Reset development database
|
# Reset development database
|
||||||
db-reset-dev:
|
db-reset-dev:
|
||||||
npm run db:reset-dev
|
bun run scripts/setup-postgres.js --drop
|
||||||
|
|
||||||
# Setup development database
|
# Setup development database
|
||||||
db-setup-dev:
|
db-setup-dev:
|
||||||
npm run db:setup-dev
|
bun run scripts/setup-postgres.js
|
||||||
|
|
||||||
# Clean production database (remove test records)
|
# Clean production database (remove test records)
|
||||||
db-clean-prod:
|
db-clean-prod:
|
||||||
npm run db:cleanup-prod
|
bun run scripts/cleanup-prod-db.js
|
||||||
|
|
||||||
# Check production database for test records
|
# Check production database for test records
|
||||||
db-check-prod:
|
db-check-prod:
|
||||||
npm run db:check-prod
|
bun run scripts/check-test-records.js
|
||||||
|
|
||||||
# Create admin user
|
# Create admin user
|
||||||
admin-create:
|
admin-create:
|
||||||
@@ -213,23 +213,23 @@ admin-update-password:
|
|||||||
|
|
||||||
# Bump version
|
# Bump version
|
||||||
version-bump-patch:
|
version-bump-patch:
|
||||||
npm run version:patch
|
bun run scripts/bump-version.js patch
|
||||||
|
|
||||||
version-bump-minor:
|
version-bump-minor:
|
||||||
npm run version:minor
|
bun run scripts/bump-version.js minor
|
||||||
|
|
||||||
version-bump-major:
|
version-bump-major:
|
||||||
npm run version:major
|
bun run scripts/bump-version.js major
|
||||||
|
|
||||||
# Docker Compose shortcuts
|
# Docker Compose shortcuts
|
||||||
docker-up:
|
docker-up:
|
||||||
npm run docker:up
|
docker-compose up -d
|
||||||
|
|
||||||
docker-down:
|
docker-down:
|
||||||
npm run docker:down
|
docker-compose down
|
||||||
|
|
||||||
docker-logs:
|
docker-logs:
|
||||||
npm run docker:logs
|
docker-compose logs -f
|
||||||
|
|
||||||
# View workflow status
|
# View workflow status
|
||||||
workflow-status:
|
workflow-status:
|
||||||
|
|||||||
+3
-3
@@ -7,17 +7,17 @@
|
|||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "bun run eslint",
|
"lint": "bun run eslint",
|
||||||
"test": "bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts'",
|
"test": "bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts",
|
||||||
"test:unit": "bun test src/__tests__/unit/",
|
"test:unit": "bun test src/__tests__/unit/",
|
||||||
"test:component": "bun test src/__tests__/*.test.tsx",
|
"test:component": "bun test src/__tests__/*.test.tsx",
|
||||||
"test:run": "bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts'",
|
"test:run": "bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts",
|
||||||
"test:randomize": "bun test src/__tests__/unit/ --randomize",
|
"test:randomize": "bun test src/__tests__/unit/ --randomize",
|
||||||
"test:unit:sequential": "bun test src/__tests__/unit/ --max-concurrency=1",
|
"test:unit:sequential": "bun test src/__tests__/unit/ --max-concurrency=1",
|
||||||
"test:acceptance": "bun x playwright test e2e/",
|
"test:acceptance": "bun x playwright test e2e/",
|
||||||
"test:acceptance:headed": "bun x playwright test e2e/ --headed",
|
"test:acceptance:headed": "bun x playwright test e2e/ --headed",
|
||||||
"test:acceptance:cucumber": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts",
|
"test:acceptance:cucumber": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts",
|
||||||
"test:acceptance:cucumber:pretty": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts --format pretty:cucumber-pretty",
|
"test:acceptance:cucumber:pretty": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts --format pretty:cucumber-pretty",
|
||||||
"test:acceptance:cucumber:prod": "bun run build && (trap 'kill $(jobs -p) 2>/dev/null || true' EXIT; DATABASE_URL=${DATABASE_URL:-$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"')} DATABASE_PROVIDER=${DATABASE_PROVIDER:-postgresql} bun run start & echo 'Waiting for server to start...'; for i in {1..30}; do if curl -s http://localhost:3000 > /dev/null 2>&1; then echo 'Server ready!'; break; fi; sleep 1; done; npm run test:acceptance:cucumber)",
|
"test:acceptance:cucumber:prod": "bun run build && (trap 'kill $(jobs -p) 2>/dev/null || true' EXIT; DATABASE_URL=${DATABASE_URL:-$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"')} DATABASE_PROVIDER=${DATABASE_PROVIDER:-postgresql} bun run start & echo 'Waiting for server to start...'; for i in {1..30}; do if curl -s http://localhost:3000 > /dev/null 2>&1; then echo 'Server ready!'; break; fi; sleep 1; done; bun run test:acceptance:cucumber)",
|
||||||
"cucumber": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts",
|
"cucumber": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts",
|
||||||
"db:setup-dev": "bun run scripts/setup-postgres.js",
|
"db:setup-dev": "bun run scripts/setup-postgres.js",
|
||||||
"db:setup-dev:clean": "bun run scripts/setup-postgres.js --drop",
|
"db:setup-dev:clean": "bun run scripts/setup-postgres.js --drop",
|
||||||
|
|||||||
Reference in New Issue
Block a user