Initial commit #16
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: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # torch_checkpointing supports Python >=3.9; CI covers 3.10-3.12 to | |
| # match the torch CPU wheels used below. | |
| python-version: ["3.10", "3.11", "3.12"] | |
| torch-version: ["stable", "nightly"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| if [ "${{ matrix.torch-version }}" = "nightly" ]; then | |
| pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu | |
| else | |
| pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| fi | |
| pip install -e ".[test]" | |
| - name: Run tests | |
| run: pytest tests/ | |
| 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: Ruff lint | |
| run: ruff check . |