forked from letta-ai/letta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add workflow to build + test docker container (letta-ai#1278)
- Loading branch information
1 parent
4ddd0d4
commit 048e55f
Showing
14 changed files
with
237 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Set permissions for log directory | ||
run: | | ||
mkdir -p /home/runner/.memgpt/logs | ||
sudo chown -R $USER:$USER /home/runner/.memgpt/logs | ||
chmod -R 755 /home/runner/.memgpt/logs | ||
- name: Build and run docker dev server | ||
env: | ||
MEMGPT_PG_DB: memgpt | ||
MEMGPT_PG_USER: memgpt | ||
MEMGPT_PG_PASSWORD: memgpt | ||
MEMGPT_PG_PORT: 8888 | ||
MEMGPT_SERVER_PASS: test_server_token | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
|
||
run: docker compose -f dev-compose.yaml up --build -d | ||
#- name: "Setup Python, Poetry and Dependencies" | ||
# uses: packetcoders/[email protected] | ||
# with: | ||
# python-version: "3.12" | ||
# poetry-version: "1.8.2" | ||
# install-args: "--all-extras" | ||
|
||
- name: Wait for service | ||
run: bash scripts/wait_for_service.sh http://localhost:8083 -- echo "Service is ready" | ||
|
||
- name: Run tests with pytest | ||
env: | ||
MEMGPT_PG_DB: memgpt | ||
MEMGPT_PG_USER: memgpt | ||
MEMGPT_PG_PASSWORD: memgpt | ||
MEMGPT_PG_PORT: 8888 | ||
MEMGPT_SERVER_PASS: test_server_token | ||
MEMGPT_SERVER_URL: http://localhost:8083 | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
PYTHONPATH: ${{ github.workspace }}:${{ env.PYTHONPATH }} | ||
run: | | ||
pipx install poetry==1.8.2 | ||
poetry install -E dev | ||
poetry run pytest -s tests/test_client.py | ||
- name: Print docker logs if tests fail | ||
if: failure() | ||
run: | | ||
echo "Printing Docker Logs..." | ||
docker compose -f dev-compose.yaml logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.