mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-05-27 12:46:17 -05:00
- Shows 🚧 Under Construction badge next to brand
- Bar hides on scroll down, reappears on scroll up
- Always visible at top of page
- Badge hidden on mobile to save space
160 lines
4.3 KiB
YAML
160 lines
4.3 KiB
YAML
name: TinyTorch CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev]
|
|
pull_request:
|
|
branches: [main, dev]
|
|
workflow_dispatch:
|
|
inputs:
|
|
preflight_level:
|
|
description: 'Preflight check level'
|
|
required: false
|
|
default: 'standard'
|
|
type: choice
|
|
options:
|
|
- quick
|
|
- standard
|
|
- full
|
|
|
|
jobs:
|
|
preflight:
|
|
name: Preflight Checks
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.10', '3.11', '3.12']
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install -e .
|
|
|
|
- name: Run Preflight Checks (Quick)
|
|
if: github.event_name == 'pull_request'
|
|
run: |
|
|
python -m tito.main dev preflight --quick --ci
|
|
|
|
- name: Run Preflight Checks (Standard)
|
|
if: github.event_name == 'push' || github.event.inputs.preflight_level == 'standard'
|
|
run: |
|
|
python -m tito.main dev preflight --ci
|
|
|
|
- name: Run Preflight Checks (Full)
|
|
if: github.event.inputs.preflight_level == 'full'
|
|
run: |
|
|
python -m tito.main dev preflight --full --ci
|
|
|
|
e2e-quick:
|
|
name: E2E Quick Tests
|
|
runs-on: ubuntu-latest
|
|
needs: preflight
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install -e .
|
|
pip install pytest
|
|
|
|
- name: Run E2E Quick Tests
|
|
run: |
|
|
pytest tests/e2e/ -v -k quick --tb=short
|
|
|
|
module-tests:
|
|
name: Module Tests
|
|
runs-on: ubuntu-latest
|
|
needs: preflight
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install -e .
|
|
pip install pytest pytest-cov
|
|
|
|
- name: Run Module Tests
|
|
run: |
|
|
pytest tests/01_tensor/ tests/02_activations/ tests/03_layers/ -v --tb=short
|
|
continue-on-error: true
|
|
|
|
cli-smoke:
|
|
name: CLI Smoke Tests
|
|
runs-on: ubuntu-latest
|
|
needs: preflight
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install -e .
|
|
pip install pytest
|
|
|
|
- name: Run CLI Tests
|
|
run: |
|
|
pytest tests/cli/ -v --tb=short
|
|
|
|
summary:
|
|
name: CI Summary
|
|
runs-on: ubuntu-latest
|
|
needs: [preflight, e2e-quick, module-tests, cli-smoke]
|
|
if: always()
|
|
steps:
|
|
- name: Check Results
|
|
run: |
|
|
echo "## CI Summary" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
|
|
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Preflight | ${{ needs.preflight.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| E2E Quick | ${{ needs.e2e-quick.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Module Tests | ${{ needs.module-tests.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| CLI Smoke | ${{ needs.cli-smoke.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
if [[ "${{ needs.preflight.result }}" == "failure" ]]; then
|
|
echo "❌ Preflight checks failed. Please run 'tito dev preflight' locally." >> $GITHUB_STEP_SUMMARY
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Core checks passed!" >> $GITHUB_STEP_SUMMARY
|
|
|