Fix config.ini inline comments and collator null handling (closes #15) #46
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| # Minimal permissions — GITHUB_TOKEN can only read repo contents. | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: '3.11' | |
| architecture: 'arm64' | |
| cache: 'pip' | |
| - name: Install tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e '.[dev]' | |
| pip install pre-commit | |
| - name: Ruff | |
| run: | | |
| ruff check . | |
| ruff format --check . | |
| - name: Pre-commit (ruff hooks) | |
| run: pre-commit run --all-files | |
| unit: | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11'] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: 'arm64' | |
| cache: 'pip' | |
| - name: Install project | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e '.[dev]' | |
| # CPU-only torch satisfies all import chains (device.py, cli_typer, etc.) | |
| # without needing the full GPU-accelerated build (~250 MB vs ~2 GB). | |
| pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| - name: Env info | |
| run: | | |
| python - << 'PY' | |
| import platform; print('Platform:', platform.platform()) | |
| try: | |
| import torch | |
| print('torch:', torch.__version__) | |
| print('MPS built:', torch.backends.mps.is_built()) | |
| print('MPS available:', torch.backends.mps.is_available()) | |
| except Exception as e: | |
| print('torch not importable:', e) | |
| PY | |
| - name: Run fast tests (exclude slow) | |
| env: | |
| HF_HUB_DISABLE_TELEMETRY: '1' | |
| run: | | |
| mkdir -p test-reports | |
| pytest -q -m "not slow" \ | |
| tests/test_bootstrap.py \ | |
| tests/test_config_defaults.py \ | |
| tests/test_cli_help.py \ | |
| tests/test_system_check.py \ | |
| tests/test_config.py \ | |
| tests/test_wizard_config_store.py \ | |
| --junitxml=test-reports/junit-${{ matrix.python-version }}.xml | |
| - name: Upload test report | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: junit-${{ matrix.python-version }} | |
| path: test-reports/*.xml | |
| unit-gemma4: | |
| runs-on: macos-latest | |
| timeout-minutes: 35 | |
| needs: [lint] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: '3.11' | |
| architecture: 'arm64' | |
| cache: 'pip' | |
| - name: Install project and Gemma 4 stack | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e '.[dev]' | |
| pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| pip install -r requirements/requirements-gemma4.txt | |
| - name: Run fast tests (Gemma 4 env) | |
| env: | |
| HF_HUB_DISABLE_TELEMETRY: '1' | |
| GEMMA_MACOS_EXPECT_GEMMA4_STACK: '1' | |
| run: | | |
| pytest -q -m "not slow" \ | |
| --ignore=tests/test_visualizer.py \ | |
| --ignore=tests/test_visualizer_contract.py | |
| cli: | |
| runs-on: macos-latest | |
| timeout-minutes: 15 | |
| needs: [lint, unit, unit-gemma4] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: '3.11' | |
| architecture: 'arm64' | |
| cache: 'pip' | |
| - name: Install project | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e '.[dev]' | |
| # CPU-only torch satisfies import chains for cli_typer → device.py | |
| pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| - name: Typer import | |
| run: | | |
| python - <<'PY' | |
| import gemma_tuner | |
| import gemma_tuner.cli_typer | |
| import gemma_tuner.main | |
| import gemma_tuner.core.bootstrap | |
| print('cli import OK') | |
| PY | |
| - name: CLI smoke | |
| run: | | |
| gemma-macos-tuner system-check |