Files
langflow/.github/workflows/docker_test.yml
Gabriel Luiz Freitas Almeida ebdc2015b6 chore: Enhance CI workflow to include Docker testing (#10104)
* chore: Update changes-filter.yaml to include docker paths

Added docker-related paths to the changes filter configuration, ensuring that changes in the docker directory, uv.lock, pyproject.toml, and backend source files are tracked appropriately.

* chore: Update docker_test workflow trigger to use workflow_call

Modified the GitHub Actions workflow for testing Docker images to trigger on workflow_call instead of push events, streamlining the CI process for Docker-related changes.

* chore: Enhance CI workflow to include Docker testing

Added a new job for testing Docker images in the CI workflow, ensuring that Docker-related changes are validated. Updated conditions to include Docker outputs in the path filter and CI success summary.

* chore: Update changes-filter.yaml to include frontend paths

Added frontend source paths and .dockerignore to the changes filter configuration, ensuring that changes in the frontend directory are tracked alongside existing Docker-related paths.
2025-10-08 21:10:53 +00:00

81 lines
3.2 KiB
YAML

name: Test Docker images
on:
workflow_call:
workflow_dispatch:
env:
POETRY_VERSION: "1.8.2"
jobs:
test-docker:
runs-on: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
name: Test docker images
steps:
- uses: actions/checkout@v5
- name: Set container runtime
run: |
if command -v docker &> /dev/null; then
echo "CONTAINER_RUNTIME=docker" >> $GITHUB_ENV
elif command -v podman &> /dev/null; then
echo "CONTAINER_RUNTIME=podman" >> $GITHUB_ENV
else
echo "Error: Neither docker nor podman found"
exit 1
fi
echo "Using container runtime: ${{ env.CONTAINER_RUNTIME }}"
- name: Docker System Info and Cleanup
run: |
echo "=== Docker System Usage Before Cleanup ==="
${{ env.CONTAINER_RUNTIME }} system df || true
if command -v docker &> /dev/null; then
docker buildx du || true
fi
echo "=== Cleaning up Docker System ==="
${{ env.CONTAINER_RUNTIME }} system prune -af --volumes || true
if command -v docker &> /dev/null; then
docker buildx prune -af || true
fi
echo "=== Docker System Usage After Cleanup ==="
${{ env.CONTAINER_RUNTIME }} system df || true
if command -v docker &> /dev/null; then
docker buildx du || true
fi
- name: Build image
run: |
${{ env.CONTAINER_RUNTIME }} build -t langflowai/langflow:latest-dev \
-f docker/build_and_push.Dockerfile \
.
- name: Test image
run: |
expected_version=$(cat pyproject.toml | grep version | head -n 1 | cut -d '"' -f 2)
version=$(${{ env.CONTAINER_RUNTIME }} run --rm --entrypoint bash langflowai/langflow:latest-dev -c "python -c 'from langflow.utils.version import get_version_info; print(get_version_info()[\"version\"])'")
if [ "$expected_version" != "$version" ]; then
echo "Expected version: $expected_version"
echo "Actual version: $version"
exit 1
fi
- name: Build backend image
run: |
${{ env.CONTAINER_RUNTIME }} build -t langflowai/langflow-backend:latest-dev \
--build-arg LANGFLOW_IMAGE=langflowai/langflow:latest-dev \
-f docker/build_and_push_backend.Dockerfile \
.
- name: Test backend image
run: |
expected_version=$(cat pyproject.toml | grep version | head -n 1 | cut -d '"' -f 2)
version=$(${{ env.CONTAINER_RUNTIME }} run --rm --entrypoint bash langflowai/langflow-backend:latest-dev -c "python -c 'from langflow.utils.version import get_version_info; print(get_version_info()[\"version\"])'")
if [ "$expected_version" != "$version" ]; then
echo "Expected version: $expected_version"
echo "Actual version: $version"
exit 1
fi
- name: Build frontend image
run: |
${{ env.CONTAINER_RUNTIME }} build -t langflowai/langflow-frontend:latest-dev \
-f docker/frontend/build_and_push_frontend.Dockerfile \
.