mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
145 lines
3.6 KiB
YAML
145 lines
3.6 KiB
YAML
name: AutoGPT Platform - Frontend CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, dev]
|
|
paths:
|
|
- ".github/workflows/platform-frontend-ci.yml"
|
|
- "autogpt_platform/frontend/**"
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/platform-frontend-ci.yml"
|
|
- "autogpt_platform/frontend/**"
|
|
merge_group:
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: autogpt_platform/frontend
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "21"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
|
|
- name: Run lint
|
|
run: |
|
|
yarn lint
|
|
|
|
type-check:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "21"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
|
|
- name: Run tsc check
|
|
run: |
|
|
yarn type-check
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chromium, webkit]
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
# We know these are here, don't report this as a security vulnerability
|
|
# This is used as the default credential for the entire system's RabbitMQ instance
|
|
# If you want to replace this, you can do so by making our entire system generate
|
|
# new credentials for each local user and update the environment variables in
|
|
# the backend service, docker composes, and examples
|
|
RABBITMQ_DEFAULT_USER: "rabbitmq_user_default"
|
|
RABBITMQ_DEFAULT_PASS: "k0VMxyIJF9S35f3x2uaw5IWAl6Y536O7"
|
|
services:
|
|
redis:
|
|
image: bitnami/redis:6.2
|
|
env:
|
|
REDIS_PASSWORD: testpassword
|
|
ports:
|
|
- 6379:6379
|
|
rabbitmq:
|
|
image: rabbitmq:3.12-management
|
|
ports:
|
|
- 5672:5672
|
|
- 15672:15672
|
|
env:
|
|
RABBITMQ_DEFAULT_USER: ${{ env.RABBITMQ_DEFAULT_USER }}
|
|
RABBITMQ_DEFAULT_PASS: ${{ env.RABBITMQ_DEFAULT_PASS }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "21"
|
|
|
|
- name: Free Disk Space (Ubuntu)
|
|
uses: jlumbroso/free-disk-space@main
|
|
with:
|
|
large-packages: false # slow
|
|
docker-images: false # limited benefit
|
|
|
|
- name: Copy default supabase .env
|
|
run: |
|
|
cp ../supabase/docker/.env.example ../.env
|
|
|
|
- name: Copy backend .env
|
|
run: |
|
|
cp ../backend/.env.example ../backend/.env
|
|
|
|
- name: Run docker compose
|
|
run: |
|
|
docker compose -f ../docker-compose.yml up -d
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
|
|
- name: Setup Builder .env
|
|
run: |
|
|
cp .env.example .env
|
|
|
|
- name: Install Browser '${{ matrix.browser }}'
|
|
run: yarn playwright install --with-deps ${{ matrix.browser }}
|
|
|
|
- name: Run tests
|
|
run: |
|
|
yarn test --project=${{ matrix.browser }}
|
|
|
|
- name: Print Docker Compose logs in debug mode
|
|
if: runner.debug
|
|
run: |
|
|
docker compose -f ../docker-compose.yml logs
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: ${{ !cancelled() }}
|
|
with:
|
|
name: playwright-report-${{ matrix.browser }}
|
|
path: playwright-report/
|
|
retention-days: 30
|