diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 328accd9..0dda6698 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,3 +57,25 @@ jobs: JIRA_USER_EMAIL: dummy@example.com GITHUB_TOKEN: dummy run: uv run pytest tests/unit/ -q + + container-build: + name: Container Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build production image + run: docker build --tag forge-ci:${{ github.sha }} . + + - name: Verify application imports + run: >- + docker run --rm + --env JIRA_BASE_URL=https://example.atlassian.net + --env JIRA_API_TOKEN=dummy + --env JIRA_USER_EMAIL=dummy@example.com + --env GITHUB_TOKEN=dummy + forge-ci:${{ github.sha }} + python -c "import forge; from forge.main import app; assert app is not None" + + - name: Verify Forge CLI entry point + run: docker run --rm forge-ci:${{ github.sha }} forge --help diff --git a/Dockerfile b/Dockerfile index 026e74f4..4a22ff9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && rm -rf /var/lib/apt/lists/* -# Install Python dependencies + +# Install Python dependencies and copy application code COPY pyproject.toml README.md ./ +COPY src/ ./src/ + RUN pip install --no-cache-dir build && \ pip wheel --no-cache-dir --wheel-dir /wheels -e . @@ -30,9 +33,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ COPY --from=builder /wheels /wheels RUN pip install --no-cache-dir /wheels/* && rm -rf /wheels -# Copy application code -COPY src/ ./src/ - # Switch to non-root user USER forge