Feature: Infer OME-Zarr axes_units from BioImage.dimension_properties #188
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| # Run every Monday at 10:24:00 PST | |
| - cron: "24 18 * * 1" | |
| workflow_dispatch: | |
| jobs: | |
| # Check that all files listed in manifest make it into build | |
| check-manifest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - run: pip install check-manifest && check-manifest | |
| # Check tests pass on multiple Python and OS combinations | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ 3.11, 3.12, 3.13] | |
| os: [ubuntu-latest, macOS-latest, windows-latest] | |
| permissions: | |
| id-token: write # This is required for requesting the JWT | |
| contents: read # This is required for actions/checkout | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| lfs: true # For test files | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: extractions/setup-just@v4 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install .[test] | |
| - name: Run Tests | |
| run: just test | |
| - name: Upload Codecov | |
| uses: codecov/codecov-action@v7 | |
| # Check linting, formating, types, etc. | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - uses: extractions/setup-just@v4 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install .[lint] | |
| - name: Lint | |
| run: just lint | |
| # Publish to PyPI if test, lint, and manifest checks passed | |
| publish: | |
| if: "success() && startsWith(github.ref, 'refs/tags/')" | |
| needs: [check-manifest, test, lint] | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build wheel | |
| - name: Build Package | |
| run: | | |
| python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| # GitHub does not provide a "all status checks must pass" option | |
| # in branch protection settings. Instead, you have to specify exactly | |
| # what status checks want to require to pass before merging. However, | |
| # naming each individual check would be effectively impossible. | |
| # Therefore, by creating this stage in every repo in the org we can | |
| # require "Report Result" to pass before merging and this stage can | |
| # represent the result of the other checks where it only passes if | |
| # all the other checks pass. | |
| results: | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| needs: [check-manifest, test, lint] | |
| runs-on: ubuntu-latest | |
| name: Report Result | |
| steps: | |
| - run: exit 1 | |
| # see https://stackoverflow.com/a/67532120/4907315 | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') | |
| || contains(needs.*.result, 'cancelled') | |
| }} | |