Update project to require Python 3.10 #75
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: Continuous Integration | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| env: | |
| UV_VERSION: 0.8.4 | |
| jobs: | |
| lint_and_type_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Install UV | |
| run: | | |
| curl -LsSf "https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh" | sh | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Run ruff | |
| run: uv run ruff check snappylapy --output-format=github | |
| - name: Run mypy | |
| if: always() | |
| run: uv run mypy snappylapy | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.9, 3.13] | |
| include-extras: [true] | |
| include: | |
| - python-version: 3.9 | |
| include-extras: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Install UV | |
| run: | | |
| curl -LsSf "https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh" | sh | |
| - name: Pin python version | |
| run: uv python pin ${{ matrix.python-version }} | |
| - name: Build and install package | |
| run: | | |
| uv build | |
| uv venv | |
| source .venv/bin/activate | |
| DIST_FILE=$(ls dist/snappylapy-*.tar.gz | head -n 1) | |
| if [ "${{ matrix.include-extras }}" = "true" ]; then | |
| uv pip install "snappylapy[all]@$DIST_FILE" | |
| else | |
| uv pip install "snappylapy@$DIST_FILE" | |
| fi | |
| # Remove the snappylapy folder to ensure the installed package is used for the test | |
| - name: Remove snappylapy folder in the cloned repository | |
| run: rm -rf snappylapy | |
| - name: Run tests | |
| run: | | |
| source .venv/bin/activate | |
| pytest tests/ --junit-xml=test-results.xml | |
| - name: Surface failing tests | |
| if: always() | |
| uses: pmeier/pytest-results-action@main | |
| with: | |
| # A list of JUnit XML files, directories containing the former, and wildcard | |
| # patterns to process. | |
| # See @actions/glob for supported patterns. | |
| path: test-results.xml | |
| # (Optional) Add a summary of the results at the top of the report | |
| summary: true | |
| # (Optional) Fail the workflow if no JUnit XML was found. | |
| fail-on-empty: true | |
| # (Optional) Title of the test results section in the workflow summary | |
| title: Test results |