mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Our CI costs are skyrocketing, most of it because of `platform-fullstack-ci.yml`. The `types` job currently uses in a `big-boi` runner (= expensive), but doesn't need to. Additionally, the "end-to-end tests" job is currently in `platform-frontend-ci.yml` instead of `platform-fullstack-ci.yml`, causing it not to run on backend changes (which it should). ### Changes 🏗️ - Simplify `check-api-types` job (renamed from `types`) and make it use regular `ubuntu-latest` runner - Export API schema from backend through CLI (instead of spinning it up in docker) - Fix dependency caching in `platform-fullstack-ci.yml` (based on recent improvements in `platform-frontend-ci.yml`) - Move `e2e_tests` job to `platform-fullstack-ci.yml` Out-of-scope but necessary: - Eliminate module-level init of OpenAI client in `backend.copilot.service` ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - CI
151 lines
3.9 KiB
YAML
151 lines
3.9 KiB
YAML
name: AutoGPT Platform - Frontend CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, dev]
|
|
paths:
|
|
- ".github/workflows/platform-frontend-ci.yml"
|
|
- "autogpt_platform/frontend/**"
|
|
- "autogpt_platform/backend/Dockerfile"
|
|
- "autogpt_platform/docker-compose.yml"
|
|
- "autogpt_platform/docker-compose.platform.yml"
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/platform-frontend-ci.yml"
|
|
- "autogpt_platform/frontend/**"
|
|
- "autogpt_platform/backend/Dockerfile"
|
|
- "autogpt_platform/docker-compose.yml"
|
|
- "autogpt_platform/docker-compose.platform.yml"
|
|
merge_group:
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'merge_group' && format('merge-queue-{0}', github.ref) || format('{0}-{1}', github.ref, github.event.pull_request.number || github.sha) }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: autogpt_platform/frontend
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
components-changed: ${{ steps.filter.outputs.components }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Check for component changes
|
|
uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
components:
|
|
- 'autogpt_platform/frontend/src/components/**'
|
|
|
|
- name: Enable corepack
|
|
run: corepack enable
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "22.18.0"
|
|
cache: "pnpm"
|
|
cache-dependency-path: autogpt_platform/frontend/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies to populate cache
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Enable corepack
|
|
run: corepack enable
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "22.18.0"
|
|
cache: "pnpm"
|
|
cache-dependency-path: autogpt_platform/frontend/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run lint
|
|
run: pnpm lint
|
|
|
|
chromatic:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
# Disabled: to re-enable, remove 'false &&' from the condition below
|
|
if: >-
|
|
false
|
|
&& (github.ref == 'refs/heads/dev' || github.base_ref == 'dev')
|
|
&& needs.setup.outputs.components-changed == 'true'
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Enable corepack
|
|
run: corepack enable
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "22.18.0"
|
|
cache: "pnpm"
|
|
cache-dependency-path: autogpt_platform/frontend/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run Chromatic
|
|
uses: chromaui/action@latest
|
|
with:
|
|
projectToken: chpt_9e7c1a76478c9c8
|
|
onlyChanged: true
|
|
workingDir: autogpt_platform/frontend
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
exitOnceUploaded: true
|
|
|
|
integration_test:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Enable corepack
|
|
run: corepack enable
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "22.18.0"
|
|
cache: "pnpm"
|
|
cache-dependency-path: autogpt_platform/frontend/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Generate API client
|
|
run: pnpm generate:api
|
|
|
|
- name: Run Integration Tests
|
|
run: pnpm test:unit
|