Skip to content

Polish: fix linter warnings, add CURRENT_STATUS.md, update README to … #2

Polish: fix linter warnings, add CURRENT_STATUS.md, update README to …

Polish: fix linter warnings, add CURRENT_STATUS.md, update README to … #2

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
NODE_VERSION: 18
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- run: npm ci
- run: npm run lint
typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- run: npm ci
- run: npm run db:generate
- run: npx tsc --noEmit
test:
name: Unit Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: commflock_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/commflock_test
NEXTAUTH_SECRET: test-secret
NEXTAUTH_URL: http://localhost:3000
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- run: npm ci
- run: npm run db:generate
- run: npx prisma migrate deploy
- run: npm test
- uses: codecov/codecov-action@v3
if: always()
with:
files: ./coverage/coverage-final.json
e2e:
name: E2E Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: commflock_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/commflock_test
NEXTAUTH_SECRET: test-secret
NEXTAUTH_URL: http://localhost:3000
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- run: npm ci
- run: npm run db:generate
- run: npx prisma migrate deploy
- run: npm run seed
- run: npx playwright install --with-deps
- run: npm run build
- name: Run E2E tests
run: npm run test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, typecheck]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- run: npm ci
- run: npm run db:generate
- run: npm run build
env:
DATABASE_URL: postgresql://user:pass@localhost:5432/db
NEXTAUTH_SECRET: build-secret
NEXTAUTH_URL: http://localhost:3000
- uses: actions/upload-artifact@v3
with:
name: build
path: .next
deploy:
name: Deploy to Netlify
runs-on: ubuntu-latest
needs: [build, test, e2e]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: nwtgck/actions-netlify@v2
with:
publish-dir: '.next'
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}