-
Notifications
You must be signed in to change notification settings - Fork 14
Add GitHub Actions workflow and dockerignore #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1c09b74
17bcce7
9e5823f
5c450be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Git | ||
| .git | ||
| .gitignore | ||
| .github | ||
|
|
||
| # Python | ||
| __pycache__ | ||
| *.pyc | ||
| *.pyo | ||
| *.pyd | ||
| .Python | ||
| *.so | ||
| *.egg | ||
| *.egg-info | ||
| dist | ||
| build | ||
| .venv | ||
| venv | ||
| env | ||
|
|
||
| # IDEs | ||
| .vscode | ||
| .idea | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Documentation | ||
| *.md | ||
| !README.md | ||
|
|
||
| # Docker | ||
| Dockerfile | ||
| .dockerignore | ||
|
|
||
| # Others | ||
| .env | ||
| .env.* | ||
| *.log |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||||||||||||||||||||||
| name: Build Docker Image | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||
| branches: [ main, feat/* ] | ||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||
| build-linux: | ||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||||||||||||||||||||
| uses: docker/setup-buildx-action@v3 | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Build Docker image | ||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||
| docker build --platform linux/amd64 \ | ||||||||||||||||||||||||||||||||||||
| -f dockerfiles/Dockerfile \ | ||||||||||||||||||||||||||||||||||||
| -t memu-server . | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Test image | ||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'push' | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'push' | |
| if: github.event_name == 'push' && secrets.OPENAI_API_KEY != '' |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test step exposes port 8005 on the host but the container runs on port 8000, then curls localhost:8005. However, there's no health check or retry logic. The 5-second sleep may not be sufficient for the application to fully start up, especially if it needs to initialize the MemoryService or download models. Consider adding a retry loop with a timeout or using a proper health check endpoint.
| sleep 5 | |
| curl -f http://localhost:8005 || exit 1 | |
| timeout=60 | |
| start_time=$(date +%s) | |
| until curl -fsS http://localhost:8005 >/dev/null 2>&1; do | |
| current_time=$(date +%s) | |
| elapsed=$((current_time - start_time)) | |
| if [ "$elapsed" -ge "$timeout" ]; then | |
| echo "Service did not become ready within ${timeout}s" | |
| docker logs test || true | |
| docker stop test || true | |
| exit 1 | |
| fi | |
| echo "Waiting for service to be ready... (${elapsed}s elapsed)" | |
| sleep 5 | |
| done | |
| curl -f http://localhost:8005 |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test step only runs on push events (line 25), which means pull requests won't be tested. This creates a gap in CI coverage where pull request changes won't be validated before merging. Consider removing or adjusting this condition to ensure tests run for both push and pull_request events.
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ARM64 build job does not include any test step to verify the built image, unlike the AMD64 build job. Consider adding a similar test step for the ARM64 image to ensure cross-platform compatibility and catch architecture-specific issues.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow triggers on branches matching 'feat/', but GitHub Actions branch patterns use 'feat/**' for wildcard matching of all branches under feat/. The single asterisk pattern 'feat/' will only match branches like 'feat/x' but not 'feat/x/y'.