Update and improve test environments #318
Workflow file for this run
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_and_deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| pull_request: null | |
| workflow_dispatch: null | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: ["windows-latest", "ubuntu-latest", "macos-latest"] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| - name: Setup Conda Environment | |
| uses: conda-incubator/setup-miniconda@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| environment-file: continuous_integration/environment-${{ matrix.python-version }}.yml | |
| activate-environment: dask-image-testenv | |
| auto-activate-base: false | |
| - name: Install dask-image | |
| shell: bash -l {0} | |
| run: | | |
| conda activate dask-image-testenv | |
| python -m pip install -e .[dataframe] | |
| conda list | |
| - name: Run tests | |
| shell: bash -l {0} | |
| run: pytest -v --cov=dask_image --cov-report lcov | |
| - name: Coveralls Parallel | |
| uses: coverallsapp/github-action@v2.3.7 | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| flag-name: run-${{ matrix.test_number }} | |
| parallel: true | |
| path-to-lcov: coverage.lcov | |
| test-minimal: | |
| # Verify dask-image works without the optional `dataframe` extras | |
| # (i.e. without pandas and dask[dataframe]). | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: ["windows-latest", "ubuntu-latest", "macos-latest"] | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dask-image without dataframe extras | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[test] | |
| - name: Run tests (find_objects tests are skipped automatically) | |
| run: pytest -v | |
| test-latest-all-extras: | |
| # Verify dask-image works with the latest unfixed dependencies, including | |
| # optional `dataframe` extras so find_objects is also tested. | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: ["windows-latest", "ubuntu-latest", "macos-latest"] | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dask-image with all extras | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[dataframe,test] | |
| - name: Run tests | |
| run: pytest -v | |
| coveralls: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Coveralls Finished | |
| uses: coverallsapp/github-action@v2.3.7 | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| parallel-finished: true | |
| deploy: | |
| # This will upload a Python Package using Twine when a release is created | |
| # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
| # | |
| # This job will run when you have tagged a commit, starting with "v*" | |
| # or created a release in GitHub which includes a tag starting with "v*" | |
| # and requires that you have put your twine API key in your | |
| # github secrets (see readme for details) | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| if: contains(github.ref, 'tags') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build and publish | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| python -m build | |
| twine upload dist/* |