Test Package #140
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: Test Package | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # run every Tuesday at 17:00 UTC | |
| - cron: "0 17 * * 2" | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| python: "3.11" | |
| - os: ubuntu-latest | |
| python: "3.12" | |
| - os: ubuntu-latest | |
| python: "3.13" | |
| name: Python ${{ matrix.python }} | |
| env: | |
| OS: ${{ matrix.os }} | |
| PYTHON: ${{ matrix.python }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install the latest version of uv and setup Python | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "latest" | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Install dependencies | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 3 # The nvidia index is unreliable | |
| command: uv sync --extra cellpose --dev | |
| - name: Lint with ruff | |
| run: | | |
| uv run ruff check --fix --exit-non-zero-on-fix spatiomic | |
| - name: Format with ruff | |
| run: | | |
| uv run ruff format --check spatiomic | |
| - name: Type check with mypy | |
| run: | | |
| uv run mypy -p spatiomic | |
| - name: Check security with bandit | |
| run: | | |
| uv run bandit --verbose --ini .bandit.ini -ll --recursive spatiomic | |
| - name: Test with pytest | |
| run: | | |
| uv run coverage run -m pytest --maxfail=10 -m "not gpu" -m "not no_github_ci" | |
| uv run coverage xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} |