Skip to content

fix: format CI workflow and add pip caching step #3

fix: format CI workflow and add pip caching step

fix: format CI workflow and add pip caching step #3

Workflow file for this run

name: CI
on:
push:
branches: ["master", "main"]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
# 🔹 Cache pip downloads (speed boost)
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run app import check
run: |
python -c "import main"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: |
docker build -t fastapi-app .