lamhieu/docsifer
13
1name: CI2 3on:4 push:5 branches: [main]6 pull_request:7 branches: [main]8 workflow_dispatch:9 10jobs:11 lint-and-test:12 name: Lint & Unit Tests13 runs-on: ubuntu-latest14 steps:15 - uses: actions/checkout@v416 17 - uses: actions/setup-python@v518 with:19 python-version: "3.11"20 cache: pip21 cache-dependency-path: |22 requirements.txt23 pyproject.toml24 25 - name: Install system packages26 # Required by python-magic (libmagic1) and audio transcription (ffmpeg).27 run: |28 sudo apt-get update29 sudo apt-get install -y --no-install-recommends libmagic1 ffmpeg30 31 - name: Install Python dependencies32 run: |33 python -m pip install --upgrade pip34 pip install -r requirements.txt35 pip install \36 "pytest>=8.0,<9" "pytest-asyncio>=0.23,<1" \37 "ruff>=0.6,<1"38 39 - name: Ruff check40 run: ruff check docsifer tests41 42 - name: Pytest43 env:44 DOCSIFER_LOG_JSON: "false"45 DOCSIFER_ANALYTICS_ENABLED: "false"46 run: pytest tests -q47 48 docker-build:49 name: Docker Build (smoke)50 runs-on: ubuntu-latest51 needs: lint-and-test52 if: github.event_name == 'push' && github.ref == 'refs/heads/main'53 steps:54 - uses: actions/checkout@v455 - uses: docker/setup-buildx-action@v356 - name: Build image (no push)57 uses: docker/build-push-action@v558 with:59 context: .60 push: false61 load: true62 tags: docsifer:ci63 cache-from: type=gha64 cache-to: type=gha,mode=max65 