Update ci.yml #17
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: CI / Test & Docker Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test-and-build: | |
| runs-on: ubuntu-latest | |
| env: | |
| # Force local ffmpeg usage | |
| MODE: local | |
| FFMPEG_PATH: /usr/bin/ffmpeg | |
| FFPROBE_PATH: /usr/bin/ffprobe | |
| VMAF_PATH: /usr/bin/true # no-op if VMAF not installed | |
| # JWT settings for tests | |
| SECRET_KEY: testsecret | |
| ALGORITHM: HS256 | |
| ACCESS_TOKEN_EXPIRE_MINUTES: 60 | |
| # AWS disabled in CI | |
| AWS_ACCESS_KEY_ID: '' | |
| AWS_SECRET_ACCESS_KEY: '' | |
| AWS_REGION: us-east-1 | |
| # API server defaults (not used by tests) | |
| HOST: 0.0.0.0 | |
| PORT: 8000 | |
| WORKERS: 1 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install system FFmpeg | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ffmpeg | |
| - name: Install Python dependencies, pytest & httpx | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --no-cache-dir -r requirements.txt | |
| pip install pytest httpx | |
| - name: Export PYTHONPATH | |
| run: echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV | |
| - name: Run pytest | |
| run: pytest --maxfail=1 --disable-warnings -q | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and load Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| load: true | |
| push: false | |
| tags: ffmpeg-api-service:latest | |