Skip to content

test

test #2

Workflow file for this run

name: Backend CI

Check failure on line 1 in .github/workflows/backend.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/backend.yml

Invalid workflow file

(Line: 47, Col: 12): Job 'deploy' depends on unknown job 'lint-test'.
on:
pull_request:
paths:
- "backend/**"
push:
branches: [master]
paths:
- "backend/**"
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "backend/uv.lock"
- name: Install dependencies
run: uv sync --dev
- name: Run ruff
run: uv run ruff check .
- name: Run mypy
run: uv run mypy src tests
- name: Run pytest with coverage
run: uv run pytest --cov=src --cov-report=term-missing --cov-fail-under=70
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: lint-test
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "backend/uv.lock"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install npm dependencies
run: npm ci
- name: Install Python dependencies
run: uv sync --dev
- name: Deploy Cloudflare Worker
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
run: uv run pywrangler deploy