mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
127 lines
3 KiB
YAML
127 lines
3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
NODE_VERSION: 20.18.1
|
|
PNPM_VERSION: 10.8.1
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: ${{ env.PNPM_VERSION }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Build Next.js
|
|
run: npx dotenvx run -f .env.test -- pnpm build
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:15.4
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_DB: roo_code_test
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: ${{ env.PNPM_VERSION }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
# - name: Build Next.js for E2E tests
|
|
# run: pnpm build
|
|
# env:
|
|
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
|
|
- name: Run linter
|
|
run: pnpm lint
|
|
|
|
- name: Run type checker
|
|
run: pnpm check-types
|
|
|
|
- name: Setup database schema
|
|
run: pnpm db:test:push --force
|
|
env:
|
|
DATABASE_URL: postgres://postgres:password@localhost:5432/roo_code_test
|
|
|
|
- name: Run unit tests
|
|
run: pnpm test # -- --coverage
|
|
env:
|
|
DATABASE_URL: postgres://postgres:password@localhost:5432/roo_code_test
|
|
|
|
# - name: Upload coverage reports to Codecov
|
|
# uses: codecov/codecov-action@v4
|
|
# env:
|
|
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
# - name: Install Playwright (used for Storybook and E2E tests)
|
|
# run: npx playwright install --with-deps
|
|
|
|
# - name: Run storybook tests
|
|
# run: pnpm test-storybook:ci
|
|
|
|
# - name: Run E2E tests
|
|
# run: npx percy exec -- npm run test:e2e
|
|
# env:
|
|
# PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|
|
# CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
|
|
|
|
# - uses: actions/upload-artifact@v4
|
|
# if: always()
|
|
# with:
|
|
# name: test-results
|
|
# path: test-results/
|
|
# retention-days: 7
|
|
|
|
check:
|
|
needs: [build, test]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: NO-OP
|
|
run: echo "All checks passed."
|