mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-09 22:35:54 -05:00
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/setup-node/releases">actions/setup-node's releases</a>.</em></p> <blockquote> <h2>v6.0.0</h2> <h2>What's Changed</h2> <p><strong>Breaking Changes</strong></p> <ul> <li>Limit automatic caching to npm, update workflows and documentation by <a href="https://github.com/priyagupta108"><code>@priyagupta108</code></a> in <a href="https://redirect.github.com/actions/setup-node/pull/1374">actions/setup-node#1374</a></li> </ul> <p><strong>Dependency Upgrades</strong></p> <ul> <li>Upgrade ts-jest from 29.1.2 to 29.4.1 and document breaking changes in v5 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/setup-node/pull/1336">#1336</a></li> <li>Upgrade prettier from 2.8.8 to 3.6.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/setup-node/pull/1334">#1334</a></li> <li>Upgrade actions/publish-action from 0.3.0 to 0.4.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/setup-node/pull/1362">#1362</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-node/compare/v5...v6.0.0">https://github.com/actions/setup-node/compare/v5...v6.0.0</a></p> <h2>v5.0.0</h2> <h2>What's Changed</h2> <h3>Breaking Changes</h3> <ul> <li>Enhance caching in setup-node with automatic package manager detection by <a href="https://github.com/priya-kinthali"><code>@priya-kinthali</code></a> in <a href="https://redirect.github.com/actions/setup-node/pull/1348">actions/setup-node#1348</a></li> </ul> <p>This update, introduces automatic caching when a valid <code>packageManager</code> field is present in your <code>package.json</code>. This aims to improve workflow performance and make dependency management more seamless. To disable this automatic caching, set <code>package-manager-cache: false</code></p> <pre lang="yaml"><code>steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: package-manager-cache: false </code></pre> <ul> <li>Upgrade action to use node24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/setup-node/pull/1325">actions/setup-node#1325</a></li> </ul> <p>Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. <a href="https://github.com/actions/runner/releases/tag/v2.327.1">See Release Notes</a></p> <h3>Dependency Upgrades</h3> <ul> <li>Upgrade <code>@octokit/request-error</code> and <code>@actions/github</code> by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/setup-node/pull/1227">actions/setup-node#1227</a></li> <li>Upgrade uuid from 9.0.1 to 11.1.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/setup-node/pull/1273">actions/setup-node#1273</a></li> <li>Upgrade undici from 5.28.5 to 5.29.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/setup-node/pull/1295">actions/setup-node#1295</a></li> <li>Upgrade form-data to bring in fix for critical vulnerability by <a href="https://github.com/gowridurgad"><code>@gowridurgad</code></a> in <a href="https://redirect.github.com/actions/setup-node/pull/1332">actions/setup-node#1332</a></li> <li>Upgrade actions/checkout from 4 to 5 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/setup-node/pull/1345">actions/setup-node#1345</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/priya-kinthali"><code>@priya-kinthali</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-node/pull/1348">actions/setup-node#1348</a></li> <li><a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-node/pull/1325">actions/setup-node#1325</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-node/compare/v4...v5.0.0">https://github.com/actions/setup-node/compare/v4...v5.0.0</a></p> <h2>v4.4.0</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="2028fbc5c2"><code>2028fbc</code></a> Limit automatic caching to npm, update workflows and documentation (<a href="https://redirect.github.com/actions/setup-node/issues/1374">#1374</a>)</li> <li><a href="13427813f7"><code>1342781</code></a> Bump actions/publish-action from 0.3.0 to 0.4.0 (<a href="https://redirect.github.com/actions/setup-node/issues/1362">#1362</a>)</li> <li><a href="89d709d423"><code>89d709d</code></a> Bump prettier from 2.8.8 to 3.6.2 (<a href="https://redirect.github.com/actions/setup-node/issues/1334">#1334</a>)</li> <li><a href="cd2651c462"><code>cd2651c</code></a> Bump ts-jest from 29.1.2 to 29.4.1 (<a href="https://redirect.github.com/actions/setup-node/issues/1336">#1336</a>)</li> <li><a href="a0853c2454"><code>a0853c2</code></a> Bump actions/checkout from 4 to 5 (<a href="https://redirect.github.com/actions/setup-node/issues/1345">#1345</a>)</li> <li><a href="b7234cc9fe"><code>b7234cc</code></a> Upgrade action to use node24 (<a href="https://redirect.github.com/actions/setup-node/issues/1325">#1325</a>)</li> <li><a href="d7a11313b5"><code>d7a1131</code></a> Enhance caching in setup-node with automatic package manager detection (<a href="https://redirect.github.com/actions/setup-node/issues/1348">#1348</a>)</li> <li><a href="5e2628c959"><code>5e2628c</code></a> Bumps form-data (<a href="https://redirect.github.com/actions/setup-node/issues/1332">#1332</a>)</li> <li><a href="65beceff8e"><code>65becef</code></a> Bump undici from 5.28.5 to 5.29.0 (<a href="https://redirect.github.com/actions/setup-node/issues/1295">#1295</a>)</li> <li><a href="7e24a656e1"><code>7e24a65</code></a> Bump uuid from 9.0.1 to 11.1.0 (<a href="https://redirect.github.com/actions/setup-node/issues/1273">#1273</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/setup-node/compare/v4...v6">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> > **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nick Tindle <nick@ntindle.com>
313 lines
12 KiB
YAML
313 lines
12 KiB
YAML
name: "Copilot Setup Steps"
|
|
|
|
# Automatically run the setup steps when they are changed to allow for easy validation, and
|
|
# allow manual testing through the repository's "Actions" tab
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- .github/workflows/copilot-setup-steps.yml
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/copilot-setup-steps.yml
|
|
|
|
jobs:
|
|
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
|
|
copilot-setup-steps:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
|
|
# Set the permissions to the lowest permissions possible needed for your steps.
|
|
# Copilot will be given its own token for its operations.
|
|
permissions:
|
|
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
|
|
contents: read
|
|
|
|
# You can define any steps you want, and they will run before the agent starts.
|
|
# If you do not check out your code, Copilot will do this for you.
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
|
|
# Backend Python/Poetry setup (mirrors platform-backend-ci.yml)
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11" # Use standard version matching CI
|
|
|
|
- name: Set up Python dependency cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ~/.cache/pypoetry
|
|
key: poetry-${{ runner.os }}-${{ hashFiles('autogpt_platform/backend/poetry.lock') }}
|
|
|
|
- name: Install Poetry
|
|
run: |
|
|
# Extract Poetry version from backend/poetry.lock (matches CI)
|
|
cd autogpt_platform/backend
|
|
HEAD_POETRY_VERSION=$(python3 ../../.github/workflows/scripts/get_package_version_from_lockfile.py poetry)
|
|
echo "Found Poetry version ${HEAD_POETRY_VERSION} in backend/poetry.lock"
|
|
|
|
# Install Poetry
|
|
curl -sSL https://install.python-poetry.org | POETRY_VERSION=$HEAD_POETRY_VERSION python3 -
|
|
|
|
# Add Poetry to PATH
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
- name: Check poetry.lock
|
|
working-directory: autogpt_platform/backend
|
|
run: |
|
|
poetry lock
|
|
if ! git diff --quiet --ignore-matching-lines="^# " poetry.lock; then
|
|
echo "Warning: poetry.lock not up to date, but continuing for setup"
|
|
git checkout poetry.lock # Reset for clean setup
|
|
fi
|
|
|
|
- name: Install Python dependencies
|
|
working-directory: autogpt_platform/backend
|
|
run: poetry install
|
|
|
|
- name: Generate Prisma Client
|
|
working-directory: autogpt_platform/backend
|
|
run: poetry run prisma generate && poetry run gen-prisma-stub
|
|
|
|
# Frontend Node.js/pnpm setup (mirrors platform-frontend-ci.yml)
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "22"
|
|
|
|
- name: Enable corepack
|
|
run: corepack enable
|
|
|
|
- name: Set pnpm store directory
|
|
run: |
|
|
pnpm config set store-dir ~/.pnpm-store
|
|
echo "PNPM_HOME=$HOME/.pnpm-store" >> $GITHUB_ENV
|
|
|
|
- name: Cache frontend dependencies
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ~/.pnpm-store
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('autogpt_platform/frontend/pnpm-lock.yaml', 'autogpt_platform/frontend/package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-${{ hashFiles('autogpt_platform/frontend/pnpm-lock.yaml') }}
|
|
${{ runner.os }}-pnpm-
|
|
|
|
- name: Install JavaScript dependencies
|
|
working-directory: autogpt_platform/frontend
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
# Install Playwright browsers for frontend testing
|
|
# NOTE: Disabled to save ~1 minute of setup time. Re-enable if Copilot needs browser automation (e.g., for MCP)
|
|
# - name: Install Playwright browsers
|
|
# working-directory: autogpt_platform/frontend
|
|
# run: pnpm playwright install --with-deps chromium
|
|
|
|
# Docker setup for development environment
|
|
- name: Free up disk space
|
|
run: |
|
|
# Remove large unused tools to free disk space for Docker builds
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /usr/local/lib/android
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
|
sudo docker system prune -af
|
|
df -h
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Copy default environment files
|
|
working-directory: autogpt_platform
|
|
run: |
|
|
# Copy default environment files for development
|
|
cp .env.default .env
|
|
cp backend/.env.default backend/.env
|
|
cp frontend/.env.default frontend/.env
|
|
|
|
# Phase 1: Cache and load Docker images for faster setup
|
|
- name: Set up Docker image cache
|
|
id: docker-cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ~/docker-cache
|
|
# Use a versioned key for cache invalidation when image list changes
|
|
key: docker-images-v2-${{ runner.os }}-${{ hashFiles('.github/workflows/copilot-setup-steps.yml') }}
|
|
restore-keys: |
|
|
docker-images-v2-${{ runner.os }}-
|
|
docker-images-v1-${{ runner.os }}-
|
|
|
|
- name: Load or pull Docker images
|
|
working-directory: autogpt_platform
|
|
run: |
|
|
mkdir -p ~/docker-cache
|
|
|
|
# Define image list for easy maintenance
|
|
IMAGES=(
|
|
"redis:latest"
|
|
"rabbitmq:management"
|
|
"clamav/clamav-debian:latest"
|
|
"busybox:latest"
|
|
"kong:2.8.1"
|
|
"supabase/gotrue:v2.170.0"
|
|
"supabase/postgres:15.8.1.049"
|
|
"supabase/postgres-meta:v0.86.1"
|
|
"supabase/studio:20250224-d10db0f"
|
|
)
|
|
|
|
# Check if any cached tar files exist (more reliable than cache-hit)
|
|
if ls ~/docker-cache/*.tar 1> /dev/null 2>&1; then
|
|
echo "Docker cache found, loading images in parallel..."
|
|
for image in "${IMAGES[@]}"; do
|
|
# Convert image name to filename (replace : and / with -)
|
|
filename=$(echo "$image" | tr ':/' '--')
|
|
if [ -f ~/docker-cache/${filename}.tar ]; then
|
|
echo "Loading $image..."
|
|
docker load -i ~/docker-cache/${filename}.tar || echo "Warning: Failed to load $image from cache" &
|
|
fi
|
|
done
|
|
wait
|
|
echo "All cached images loaded"
|
|
else
|
|
echo "No Docker cache found, pulling images in parallel..."
|
|
# Pull all images in parallel
|
|
for image in "${IMAGES[@]}"; do
|
|
docker pull "$image" &
|
|
done
|
|
wait
|
|
|
|
# Only save cache on main branches (not PRs) to avoid cache pollution
|
|
if [[ "${{ github.ref }}" == "refs/heads/master" ]] || [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
|
|
echo "Saving Docker images to cache in parallel..."
|
|
for image in "${IMAGES[@]}"; do
|
|
# Convert image name to filename (replace : and / with -)
|
|
filename=$(echo "$image" | tr ':/' '--')
|
|
echo "Saving $image..."
|
|
docker save -o ~/docker-cache/${filename}.tar "$image" || echo "Warning: Failed to save $image" &
|
|
done
|
|
wait
|
|
echo "Docker image cache saved"
|
|
else
|
|
echo "Skipping cache save for PR/feature branch"
|
|
fi
|
|
fi
|
|
|
|
echo "Docker images ready for use"
|
|
|
|
# Phase 2: Build migrate service with GitHub Actions cache
|
|
- name: Build migrate Docker image with cache
|
|
working-directory: autogpt_platform
|
|
run: |
|
|
# Build the migrate image with buildx for GHA caching
|
|
docker buildx build \
|
|
--cache-from type=gha \
|
|
--cache-to type=gha,mode=max \
|
|
--target migrate \
|
|
--tag autogpt_platform-migrate:latest \
|
|
--load \
|
|
-f backend/Dockerfile \
|
|
..
|
|
|
|
# Start services using pre-built images
|
|
- name: Start Docker services for development
|
|
working-directory: autogpt_platform
|
|
run: |
|
|
# Start essential services (migrate image already built with correct tag)
|
|
docker compose --profile local up deps --no-build --detach
|
|
echo "Waiting for services to be ready..."
|
|
|
|
# Wait for database to be ready
|
|
echo "Checking database readiness..."
|
|
timeout 30 sh -c 'until docker compose exec -T db pg_isready -U postgres 2>/dev/null; do
|
|
echo " Waiting for database..."
|
|
sleep 2
|
|
done' && echo "✅ Database is ready" || echo "⚠️ Database ready check timeout after 30s, continuing..."
|
|
|
|
# Check migrate service status
|
|
echo "Checking migration status..."
|
|
docker compose ps migrate || echo " Migrate service not visible in ps output"
|
|
|
|
# Wait for migrate service to complete
|
|
echo "Waiting for migrations to complete..."
|
|
timeout 30 bash -c '
|
|
ATTEMPTS=0
|
|
while [ $ATTEMPTS -lt 15 ]; do
|
|
ATTEMPTS=$((ATTEMPTS + 1))
|
|
|
|
# Check using docker directly (more reliable than docker compose ps)
|
|
CONTAINER_STATUS=$(docker ps -a --filter "label=com.docker.compose.service=migrate" --format "{{.Status}}" | head -1)
|
|
|
|
if [ -z "$CONTAINER_STATUS" ]; then
|
|
echo " Attempt $ATTEMPTS: Migrate container not found yet..."
|
|
elif echo "$CONTAINER_STATUS" | grep -q "Exited (0)"; then
|
|
echo "✅ Migrations completed successfully"
|
|
docker compose logs migrate --tail=5 2>/dev/null || true
|
|
exit 0
|
|
elif echo "$CONTAINER_STATUS" | grep -q "Exited ([1-9]"; then
|
|
EXIT_CODE=$(echo "$CONTAINER_STATUS" | grep -oE "Exited \([0-9]+\)" | grep -oE "[0-9]+")
|
|
echo "❌ Migrations failed with exit code: $EXIT_CODE"
|
|
echo "Migration logs:"
|
|
docker compose logs migrate --tail=20 2>/dev/null || true
|
|
exit 1
|
|
elif echo "$CONTAINER_STATUS" | grep -q "Up"; then
|
|
echo " Attempt $ATTEMPTS: Migrate container is running... ($CONTAINER_STATUS)"
|
|
else
|
|
echo " Attempt $ATTEMPTS: Migrate container status: $CONTAINER_STATUS"
|
|
fi
|
|
|
|
sleep 2
|
|
done
|
|
|
|
echo "⚠️ Timeout: Could not determine migration status after 30 seconds"
|
|
echo "Final container check:"
|
|
docker ps -a --filter "label=com.docker.compose.service=migrate" || true
|
|
echo "Migration logs (if available):"
|
|
docker compose logs migrate --tail=10 2>/dev/null || echo " No logs available"
|
|
' || echo "⚠️ Migration check completed with warnings, continuing..."
|
|
|
|
# Brief wait for other services to stabilize
|
|
echo "Waiting 5 seconds for other services to stabilize..."
|
|
sleep 5
|
|
|
|
# Verify installations and provide environment info
|
|
- name: Verify setup and show environment info
|
|
run: |
|
|
echo "=== Python Setup ==="
|
|
python --version
|
|
poetry --version
|
|
|
|
echo "=== Node.js Setup ==="
|
|
node --version
|
|
pnpm --version
|
|
|
|
echo "=== Additional Tools ==="
|
|
docker --version
|
|
docker compose version
|
|
gh --version || true
|
|
|
|
echo "=== Services Status ==="
|
|
cd autogpt_platform
|
|
docker compose ps || true
|
|
|
|
echo "=== Backend Dependencies ==="
|
|
cd backend
|
|
poetry show | head -10 || true
|
|
|
|
echo "=== Frontend Dependencies ==="
|
|
cd ../frontend
|
|
pnpm list --depth=0 | head -10 || true
|
|
|
|
echo "=== Environment Files ==="
|
|
ls -la ../.env* || true
|
|
ls -la .env* || true
|
|
ls -la ../backend/.env* || true
|
|
|
|
echo "✅ AutoGPT Platform development environment setup complete!"
|
|
echo "🚀 Ready for development with Docker services running"
|
|
echo "📝 Backend server: poetry run serve (port 8000)"
|
|
echo "🌐 Frontend server: pnpm dev (port 3000)"
|