Added Test Assets #7
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 | |
steps: | |
# 1. Checkout the code | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# 2. Set up Python 3.10 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
# 3. Install Python dependencies, pytest & httpx | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --no-cache-dir -r requirements.txt | |
pip install pytest httpx | |
# 4. Run test suite | |
- name: Run pytest | |
run: pytest --maxfail=1 --disable-warnings -q | |
# 5. Set up Docker Buildx for multi-arch | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# 6. Build and load Docker image | |
- name: Build and load Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
load: true # load into the runner’s Docker daemon | |
push: false # do not push to any registry | |
tags: ffmpeg-api-service:latest |