Merge pull request #48 from Grillcheese-AI/vulkan-compilation-error-5… #157
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] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install ruff | |
| run: pip install ruff | |
| - name: Lint | |
| run: ruff check . | |
| - name: Guard deprecated Compute usage in runtime paths | |
| run: | | |
| hits="$(rg -n "from grilly import Compute|from \.\.backend\.compute import Compute|from \.compute import Compute|Compute\(" functional nn/module.py utils/tensor_conversion.py --glob "*.py" || true)" | |
| if [ -n "$hits" ]; then | |
| echo "Deprecated Compute usage detected in runtime paths:" | |
| echo "$hits" | |
| exit 1 | |
| fi | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Vulkan (software rasterizer for GPU tests) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libvulkan1 mesa-vulkan-drivers vulkan-tools | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install package | |
| run: pip install -e ".[dev]" | |
| - name: Run tests with coverage (GPU path priority) | |
| env: | |
| ALLOW_CPU_VULKAN: 1 | |
| run: pytest tests/ -v -m "not benchmark and not gpu" --ignore=tests/experimental --cov=. --cov-report=term --cov-fail-under=20 | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build | |
| run: pip install build | |
| - name: Build package | |
| run: python -m build |