remove code_style_checks and add alembic validation

This commit is contained in:
Kian Jones
2025-09-08 11:48:17 -07:00
parent b66b6f232e
commit e876dd8b36
2 changed files with 32 additions and 64 deletions

View File

@@ -30,6 +30,7 @@ jobs:
with:
files: |
apps/core/alembic/**
alembic/**
.github/workflows/alembic-validation.yml
test-sqlite:
@@ -40,12 +41,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect core directory
id: detect-core-dir
run: |
if [ -d "apps/core" ]; then
echo "dir=apps/core" >> $GITHUB_OUTPUT
echo "detected=cloud" >> $GITHUB_OUTPUT
else
echo "dir=." >> $GITHUB_OUTPUT
echo "detected=oss" >> $GITHUB_OUTPUT
fi
echo "Using core directory: $(cat $GITHUB_OUTPUT | grep '^dir=' | cut -d'=' -f2)"
- name: Install dependencies
shell: bash
working-directory: apps/core
working-directory: ${{ steps.detect-core-dir.outputs.dir }}
run: uv sync --no-install-project ${{ inputs.install-args || '--extra sqlite --extra external-tools --extra dev --extra cloud-tool-sandbox' }}
- name: Test alembic migration
working-directory: apps/core
working-directory: ${{ steps.detect-core-dir.outputs.dir }}
run: |
uv run alembic upgrade head
# kinda janky but I think this might not matter for sqlite?
@@ -53,7 +67,7 @@ jobs:
- name: Cleanup persistent data
if: ${{ always() }}
working-directory: apps/core
working-directory: ${{ steps.detect-core-dir.outputs.dir }}
run: |
echo "Cleaning up persistent data..."
sudo rm -rf ~/.letta || true
@@ -80,12 +94,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect core directory
id: detect-core-dir
run: |
if [ -d "apps/core" ]; then
echo "dir=apps/core" >> $GITHUB_OUTPUT
echo "detected=cloud" >> $GITHUB_OUTPUT
else
echo "dir=." >> $GITHUB_OUTPUT
echo "detected=oss" >> $GITHUB_OUTPUT
fi
echo "Using core directory: $(cat $GITHUB_OUTPUT | grep '^dir=' | cut -d'=' -f2)"
- name: Install dependencies
shell: bash
working-directory: apps/core
working-directory: ${{ steps.detect-core-dir.outputs.dir }}
run: uv sync --no-install-project ${{ inputs.install-args || '--extra postgres --extra external-tools --extra dev --extra cloud-tool-sandbox' }}
- name: Test alembic migration
working-directory: apps/core
working-directory: ${{ steps.detect-core-dir.outputs.dir }}
env:
LETTA_PG_PORT: 5432
LETTA_PG_USER: postgres

View File

@@ -1,59 +0,0 @@
name: Code Style Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
style-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"] # Removed 3.12+ as minimal sets the standard. Adjust Python version matrix if needed
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # Checkout the PR branch
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
activate-environment: true
- name: Install Dependencies
run: |
uv sync --extra dev --extra postgres --extra external-tools
- name: Validate PR Title
if: github.event_name == 'pull_request'
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Pyright
uses: jakebailey/pyright-action@v2
with:
python-version: ${{ matrix.python-version }}
level: "error"
continue-on-error: true
- name: Run isort
run: uv run isort --profile black --check-only --diff .
- name: Run Black
run: uv run black --check .
- name: Run Autoflake
run: uv run autoflake --remove-all-unused-imports --remove-unused-variables --in-place --recursive --ignore-init-module-imports .