Repository navigation
Pre Checkin #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pre Checkin | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: [main] # Triggers on PRs targeting `main` | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 22 * * *' # 6:00 AM Beijing Time (UTC+8) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| black: | |
| name: Check Code Style with Black | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Describe Pre Checkin scope | |
| run: | | |
| echo "Pre Checkin is the shared gate for lightweight validation before GPU CI starts." | |
| echo "Future fast, non-GPU checks can be added here so Native and OOT reuse one result." | |
| - name: Run Black | |
| uses: psf/black@stable | |
| ruff: | |
| name: Check Code Style with Ruff | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python environment | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip3 install ruff | |
| - name: Install reviewdog | |
| uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 | |
| with: | |
| reviewdog_version: v0.21.1 | |
| - name: Run ruff with reviewdog | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| ruff check . \ | |
| --output-format=rdjson \ | |
| --exit-zero \ | |
| --no-fix \ | |
| | reviewdog \ | |
| -f=rdjson \ | |
| -name="ruff" \ | |
| -reporter=github-pr-review \ | |
| -filter-mode=diff_context \ | |
| -fail-on-error=true | |
| validate-catalog: | |
| name: Validate accuracy catalogs against schema | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python environment | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip3 install jsonschema | |
| - name: Validate catalogs | |
| run: python3 .github/scripts/validate_catalog.py | |
| unit-tests: | |
| name: Run non-GPU unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # keep repository history available to unit tests | |
| - name: Set up Python environment | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| pip3 install torch --index-url https://download.pytorch.org/whl/cpu | |
| # Isolate CPU test installation from unrelated repository tags (e.g. | |
| # lmcache-*). Release and GPU benchmark versions are resolved separately. | |
| SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ATOM=0.0.0+cpu.ci pip3 install -e . | |
| pip3 install pytest msgpack quart jsonschema | |
| # atom/diffusion test deps. Without them 38 diffusion tests self-skip | |
| # via importorskip and the subsystem gets no CI coverage at all. | |
| pip3 install av pillow httpx | |
| - name: Run unit tests | |
| env: | |
| UNIT_TEST_REPORT: unit-report.xml | |
| run: bash .github/scripts/run_unit_tests.sh | |
| - name: Upload JUnit report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: unit-test-report | |
| path: unit-report.xml |