Skip to content

feat(web): show video creation time on home page and watch page #36

feat(web): show video creation time on home page and watch page

feat(web): show video creation time on home page and watch page #36

Workflow file for this run

name: CI
on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
install:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Cache pnpm store
id: cache-pnpm
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
node_modules
packages/*/node_modules
apps/*/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Install dependencies
if: steps.cache-pnpm.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
typecheck:
name: Typecheck
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Restore pnpm store
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
node_modules
packages/*/node_modules
apps/*/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Typecheck all workspaces
run: pnpm typecheck
lint:
name: Lint
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Restore pnpm store
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
node_modules
packages/*/node_modules
apps/*/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Lint all workspaces
run: pnpm lint
test:
name: Unit Tests
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Restore pnpm store
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
node_modules
packages/*/node_modules
apps/*/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Run tests
run: pnpm test
web-e2e:
name: Web E2E
runs-on: ubuntu-latest
timeout-minutes: 15
needs: install
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Restore pnpm store
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
node_modules
packages/*/node_modules
apps/*/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Install Playwright browser
run: pnpm --filter @cap/web exec playwright install --with-deps chromium
- name: Build web app
run: pnpm --filter @cap/web build
- name: Run web E2E
run: pnpm --filter @cap/web test:e2e
- name: Upload web Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: web-playwright-report
path: apps/web/.playwright/report
if-no-files-found: ignore
- name: Upload web Playwright traces
if: failure()
uses: actions/upload-artifact@v4
with:
name: web-playwright-test-results
path: apps/web/.playwright/test-results
if-no-files-found: ignore
api-e2e:
name: API E2E
runs-on: ubuntu-latest
timeout-minutes: 20
needs: install
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: cap5
POSTGRES_PASSWORD: cap5_test
POSTGRES_DB: cap5_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
NODE_ENV: test
DATABASE_URL: postgres://cap5:cap5_test@localhost:5432/cap5_test
WEB_API_PORT: 3000
JWT_SECRET: test-jwt-secret-with-32-plus-chars
MEDIA_SERVER_WEBHOOK_SECRET: test-webhook-secret-with-32-plus-chars
DEEPGRAM_API_KEY: test-deepgram
GROQ_API_KEY: test-groq
S3_ENDPOINT: http://127.0.0.1:9000
S3_PUBLIC_ENDPOINT: http://127.0.0.1:9000
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: cap5-test
S3_FORCE_PATH_STYLE: "true"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Restore pnpm store
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
node_modules
packages/*/node_modules
apps/*/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Start MinIO
run: |
docker run -d --name cap5-minio \
-p 9000:9000 \
-e MINIO_ROOT_USER="${S3_ACCESS_KEY}" \
-e MINIO_ROOT_PASSWORD="${S3_SECRET_KEY}" \
minio/minio server /data
- name: Prepare MinIO bucket
run: pnpm --filter @cap/web-api exec node ./scripts/prepare-minio.mjs
- name: Run database migrations
run: pnpm db:migrate
- name: Install Playwright browser
run: pnpm --filter @cap/web-api exec playwright install --with-deps chromium
- name: Run API E2E
run: pnpm --filter @cap/web-api test:e2e
- name: Upload API Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: api-playwright-report
path: apps/web-api/playwright-report
if-no-files-found: ignore
- name: Upload API Playwright traces
if: failure()
uses: actions/upload-artifact@v4
with:
name: api-playwright-test-results
path: apps/web-api/test-results
if-no-files-found: ignore
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, typecheck]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Restore pnpm store
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
node_modules
packages/*/node_modules
apps/*/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Build all workspaces
run: pnpm build
docker-build:
name: Docker Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: cap5:ci
cache-from: type=gha
cache-to: type=gha,mode=max