Skip to content

Update Python version in GitHub workflow #16

Update Python version in GitHub workflow

Update Python version in GitHub workflow #16

name: LLM API CI/CD - Unit Tests
on: [push, pull_request]
jobs:
# Run Unit Tests
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Optionally set up Python if needed for other steps (not shown here)
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
# Pull the latest version of the base image to ensure it's up to date
- name: Pull latest base image
run: docker pull ubuntu:20.04
# Build the Docker image, with caching of Docker layers
- name: Build Docker image
run: |
docker build -t fastapirepo . --cache-from ubuntu:20.04
# Run unit tests in the Docker container
- name: Unit Tests
run: |
docker run -e OPENAI_ORG_ID=${{ secrets.OPENAI_ORG_ID }} -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} -e HUGGINGFACE_API_TOKEN=${{ secrets.HUGGINGFACE_API_TOKEN }} fastapirepo pytest app/test_main.py