codeflash-internal/.github/workflows/mypy_aiservice.yml
Kevin Turcios b64776e284
use AsyncAzureOpenAI (#2253)
# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
2026-01-17 22:44:12 -05:00

94 lines
No EOL
2.6 KiB
YAML

name: Mypy Type Checking for Aiservice
on:
push:
branches:
- main
pull_request:
defaults:
run:
working-directory: django/aiservice
permissions:
contents: read
pull-requests: read
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.filter.outputs.aiservice == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
aiservice:
- 'django/aiservice/**'
- '.github/workflows/mypy_aiservice.yml'
skip-type-check:
needs: check-changes
if: needs.check-changes.outputs.should-run != 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Skip type check
run: echo "Skipping mypy - no changes in django/aiservice/"
type-check-aiservice:
needs: check-changes
if: needs.check-changes.outputs.should-run == 'true'
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }}
ANTHROPIC_FOUNDRY_API_KEY: ${{ secrets.ANTHROPIC_FOUNDRY_API_KEY }}
ANTHROPIC_FOUNDRY_BASE_URL: ${{ secrets.ANTHROPIC_FOUNDRY_BASE_URL }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
- name: ensure pip is available for mypy
run: uv venv --seed
- name: Install project dependencies
run: uv sync
- name: Run mypy on allowlist
run: uv run mypy --non-interactive --config-file pyproject.toml @mypy_allowlist.txt
mypy-aiservice-status:
runs-on: ubuntu-latest
needs: [check-changes, skip-type-check, type-check-aiservice]
if: always()
defaults:
run:
working-directory: .
steps:
- name: Check all job statuses
run: |
if [[ "${{ needs.type-check-aiservice.result }}" == "success" ]] || \
[[ "${{ needs.skip-type-check.result }}" == "success" ]]; then
echo "✓ Mypy type check workflow completed successfully"
exit 0
else
echo "✗ Mypy type check workflow failed"
exit 1
fi