mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-11 07:15:08 -05:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v6.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>v6-beta by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2298">actions/checkout#2298</a></li> <li>update readme/changelog for v6 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2311">actions/checkout#2311</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v5.0.0...v6.0.0">https://github.com/actions/checkout/compare/v5.0.0...v6.0.0</a></p> <h2>v6-beta</h2> <h2>What's Changed</h2> <p>Updated persist-credentials to store the credentials under <code>$RUNNER_TEMP</code> instead of directly in the local git config.</p> <p>This requires a minimum Actions Runner version of <a href="https://github.com/actions/runner/releases/tag/v2.329.0">v2.329.0</a> to access the persisted credentials for <a href="https://docs.github.com/en/actions/tutorials/use-containerized-services/create-a-docker-container-action">Docker container action</a> scenarios.</p> <h2>v5.0.1</h2> <h2>What's Changed</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v5...v5.0.1">https://github.com/actions/checkout/compare/v5...v5.0.1</a></p> <h2>v5.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> <li>Prepare v5.0.0 release by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2238">actions/checkout#2238</a></li> </ul> <h2>⚠️ Minimum Compatible Runner Version</h2> <p><strong>v2.327.1</strong><br /> <a href="https://github.com/actions/runner/releases/tag/v2.327.1">Release Notes</a></p> <p>Make sure your runner is updated to this version or newer to use this release.</p> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v4...v5.0.0">https://github.com/actions/checkout/compare/v4...v5.0.0</a></p> <h2>v4.3.1</h2> <h2>What's Changed</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v4...v4.3.1">https://github.com/actions/checkout/compare/v4...v4.3.1</a></p> <h2>v4.3.0</h2> <h2>What's Changed</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <h2>v4.2.0</h2> <ul> <li>Add Ref and Commit outputs by <a href="https://github.com/lucacome"><code>@lucacome</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1180">actions/checkout#1180</a></li> <li>Dependency updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>- <a href="https://redirect.github.com/actions/checkout/pull/1777">actions/checkout#1777</a>, <a href="https://redirect.github.com/actions/checkout/pull/1872">actions/checkout#1872</a></li> </ul> <h2>v4.1.7</h2> <ul> <li>Bump the minor-npm-dependencies group across 1 directory with 4 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li> <li>Bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li> <li>Check out other refs/* by commit by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li> <li>Pin actions/checkout's own workflows to a known, good, stable version. by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1776">actions/checkout#1776</a></li> </ul> <h2>v4.1.6</h2> <ul> <li>Check platform to set archive extension appropriately by <a href="https://github.com/cory-miller"><code>@cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1732">actions/checkout#1732</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="de0fac2e45"><code>de0fac2</code></a> Fix tag handling: preserve annotations and explicit fetch-tags (<a href="https://redirect.github.com/actions/checkout/issues/2356">#2356</a>)</li> <li><a href="064fe7f331"><code>064fe7f</code></a> Add orchestration_id to git user-agent when ACTIONS_ORCHESTRATION_ID is set (...</li> <li><a href="8e8c483db8"><code>8e8c483</code></a> Clarify v6 README (<a href="https://redirect.github.com/actions/checkout/issues/2328">#2328</a>)</li> <li><a href="033fa0dc0b"><code>033fa0d</code></a> Add worktree support for persist-credentials includeIf (<a href="https://redirect.github.com/actions/checkout/issues/2327">#2327</a>)</li> <li><a href="c2d88d3ecc"><code>c2d88d3</code></a> Update all references from v5 and v4 to v6 (<a href="https://redirect.github.com/actions/checkout/issues/2314">#2314</a>)</li> <li><a href="1af3b93b68"><code>1af3b93</code></a> update readme/changelog for v6 (<a href="https://redirect.github.com/actions/checkout/issues/2311">#2311</a>)</li> <li><a href="71cf2267d8"><code>71cf226</code></a> v6-beta (<a href="https://redirect.github.com/actions/checkout/issues/2298">#2298</a>)</li> <li><a href="069c695914"><code>069c695</code></a> Persist creds to a separate file (<a href="https://redirect.github.com/actions/checkout/issues/2286">#2286</a>)</li> <li><a href="ff7abcd0c3"><code>ff7abcd</code></a> Update README to include Node.js 24 support details and requirements (<a href="https://redirect.github.com/actions/checkout/issues/2248">#2248</a>)</li> <li><a href="08c6903cd8"><code>08c6903</code></a> Prepare v5.0.0 release (<a href="https://redirect.github.com/actions/checkout/issues/2238">#2238</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/checkout/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) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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 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> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Otto <otto@agpt.co>
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@v6
|
|
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)"
|