fix: Remove --import-mode=importlib from coverage.yml #9
This file contains hidden or 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
| name: Docker Build & Test | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| run: docker build -t invoiceflowbot:test . | |
| - name: Test Docker image (build validation only) | |
| run: | | |
| echo "✅ Docker image built successfully" | |
| docker images | grep invoiceflowbot | |
| - name: Test container startup (without bot connection) | |
| run: | | |
| # Use valid token format for aiogram validation | |
| # Format: bot_id:secret (aiogram requires this format) | |
| docker run -d --name test-bot \ | |
| -e BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz \ | |
| -e MINDEE_API_KEY=test-key \ | |
| -e MINDEE_MODEL_ID=test-model \ | |
| invoiceflowbot:test || true | |
| sleep 5 | |
| - name: Check container logs | |
| run: | | |
| echo "=== Container logs ===" | |
| docker logs test-bot 2>&1 | head -20 || true | |
| echo "=== Container status ===" | |
| docker ps -a | grep test-bot || true | |
| - name: Verify image structure | |
| run: | | |
| # Verify that the image has all necessary files | |
| # Override entrypoint to avoid running bot.py | |
| docker run --rm --entrypoint="" \ | |
| invoiceflowbot:test ls -la /app/bot.py /app/config.py /app/healthcheck.py || exit 1 | |
| echo "✅ Image structure is correct" | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| docker stop test-bot || true | |
| docker rm test-bot || true |