chore: Move core tests into apps/core (OSS Migration) [LET-4169] (#4376)

* add a bunch of test to oss

* symlink and auto-detect dir

* symlink the other direction

* add pull_request_target logic

* remove undertaker and add alembic validation

* symlink doesn't work with gh actions and add validation workflow to ensure actions in cloud and oss are lockstep

* sync these

* specify extras selectively
This commit is contained in:
Kian Jones
2025-09-04 13:46:11 -07:00
committed by GitHub
parent def95050e2
commit 2eb7da9bc3
14 changed files with 1214 additions and 61 deletions

63
.github/workflows/core-lint.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: 🐍🧹 [Core] Lint and Test
on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
changed-files:
runs-on: ubuntu-latest
name: changed-files
outputs:
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
any_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
apps/core/**
.github/workflows/core-lint.yml
main:
needs: [ changed-files ]
if: ${{ needs.changed-files.outputs.any_changed == 'true' }}
runs-on: [self-hosted, medium]
strategy:
matrix:
python-version: ["3.12"] # Adjust Python version matrix if needed
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
working-directory: apps/core
run: uv sync --no-install-project ${{ inputs.install-args || '--extra postgres --extra external-tools --extra dev --extra cloud-tool-sandbox' }}
- 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 Ruff Check
working-directory: apps/core
run: uv run ruff check --config pyproject.toml --diff .
- name: Run Ruff Format
working-directory: apps/core
run: uv run ruff format --config pyproject.toml --check --diff .