Skip to content

Update CellMapDatasetWriter integration in CellMapSubset for improved… #441

Update CellMapDatasetWriter integration in CellMapSubset for improved…

Update CellMapDatasetWriter integration in CellMapSubset for improved… #441

Workflow file for this run

name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install docs dependencies
run: |
pip install -U pip
pip install .[dev]
- name: Build docs
run: |
cd docs
make html
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install black
run: pip install black
- name: Check formatting
run: black --check src tests
test:
name: ${{ matrix.platform }} (${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
needs: [docs, format]
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12']
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache-dependency-path: "pyproject.toml"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install .[test]
- name: Test
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing
- name: Coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
tag-release:
name: Tag Release
needs: test
runs-on: ubuntu-latest
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Get PEP440 date tag
id: date_tag
run: |
year=$(date -u +'%Y' | sed 's/^0*//')
month=$(date -u +'%m' | sed 's/^0*//')
day=$(date -u +'%d' | sed 's/^0*//')
hour=$(date -u +'%H' | sed 's/^0*//')
minute=$(date -u +'%M' | sed 's/^0*//')
tag="$year.$month.$day.$hour$minute"
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
git tag ${{ steps.date_tag.outputs.tag }}
git push origin ${{ steps.date_tag.outputs.tag }}
- name: Create GitHub Release with Notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.date_tag.outputs.tag }} --generate-notes --title "${{ steps.date_tag.outputs.tag }}"
publish:
name: Publish
needs: tag-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tools
run: pip install -U pip hatch twine
- name: Build sdist and wheel
run: hatch build -t sdist -t wheel
- name: Check distributions
run: twine check dist/*
- name: Publish to PyPI
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}