Fix test_imports: treat crypten as optional in CI #5
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: [master, main] | |
| pull_request: | |
| branches: [master, main] | |
| jobs: | |
| test: | |
| name: "pytest — Python ${{ matrix.python-version }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| # Install without CrypTen (requires special build tooling) | |
| pip install -e ".[dev]" --extra-index-url https://download.pytorch.org/whl/cpu | |
| - name: Run torchcomply unit tests | |
| run: pytest torchcomply/tests/ -v --tb=short | |
| - name: Run pipeline tests (offline only) | |
| run: pytest tests/ -v --tb=short -m "not integration and not slow" | |
| lint: | |
| name: "Lint (ruff)" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - run: pip install ruff | |
| - run: ruff check torchcomply/ --select E,F,W --ignore E501 |