Skip to content

feat: PEP517

feat: PEP517 #2277

Workflow file for this run

name: CI
on:
push:
branches: [development]
paths:
- frontend/**
- bazarr/**
- migrations/**
- bazarr.py
- pyproject.toml
- uv.lock
- .python-version
- .github/workflows/ci.yml
pull_request:
branches: [development]
env:
UI_DIRECTORY: ./frontend
UI_ARTIFACT_NAME: ui
jobs:
Frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache node_modules
uses: actions/cache@v4
with:
path: "${{ env.UI_DIRECTORY }}/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-modules-
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: "${{ env.UI_DIRECTORY }}/.nvmrc"
- name: Install dependencies
run: npm install
working-directory: ${{ env.UI_DIRECTORY }}
- name: Check Types
run: npm run check:ts
working-directory: ${{ env.UI_DIRECTORY }}
- name: Check Styles
run: npm run check
working-directory: ${{ env.UI_DIRECTORY }}
- name: Check Format
run: npm run check:fmt
working-directory: ${{ env.UI_DIRECTORY }}
- name: Unit Test
run: npm test
working-directory: ${{ env.UI_DIRECTORY }}
- name: Build
run: npm run build:ci
working-directory: ${{ env.UI_DIRECTORY }}
- uses: actions/upload-artifact@v4
with:
name: ${{ env.UI_ARTIFACT_NAME }}
path: "${{ env.UI_DIRECTORY }}/build"
Backend:
runs-on: ubuntu-latest
needs: Frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache node_modules
uses: actions/cache@v4
with:
path: "${{ env.UI_DIRECTORY }}/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-modules-
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: "${{ env.UI_DIRECTORY }}/.nvmrc"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.25" # Best practice: pin uv version
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
run: uv python install python3.8
- name: Install the project
run: uv sync --all-extras --dev
- name: Remove non-development frontend build
run: rm -rf "${{ env.UI_DIRECTORY }}/build"
- name: Install UI
uses: actions/download-artifact@v4
with:
name: ${{ env.UI_ARTIFACT_NAME }}
path: "${{ env.UI_DIRECTORY }}/build"
- name: Unit Tests
run: |
uv run -- bazarr.py --no-update &
PID=$!
sleep 15
if kill -s 0 $PID
then
echo "**** Bazarr launch successful ****"
kill $PID
exit 0
else
echo "**** Bazarr launch failed ****"
exit 1
fi
- name: Minimize uv cache
run: uv cache prune --ci