Skip to content

minor [wheel]

minor [wheel] #258

Workflow file for this run

name: test-python-package
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: nschloe/action-cached-lfs-checkout@v1
- name: Install dependencies
run: |
sudo apt-get install -y pandoc jq
- uses: actions/setup-python@v6
name: Install Python
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v6
- uses: ./.github/actions/setup-rust
with:
cache: true
- name: Install the project
run: uv sync --all-groups
- name: Run tests
run: uv run pytest tests
- name: Get SnapATAC2 version
id: get_version
shell: bash
run: |
VERSION=$(uv run python -c "import snapatac2;print('.'.join(snapatac2.__version__.split('.')[:2]))")
echo "VERSION=$VERSION" >> $GITHUB_ENV
IS_DEV=$(uv run python -c "import snapatac2;print('dev' in snapatac2.__version__)")
if [[ $IS_DEV == "True" ]]; then
echo "DEPLOYMENT=dev" >> $GITHUB_ENV
else
echo "DEPLOYMENT=stable" >> $GITHUB_ENV
fi
- name: Build doc
shell: bash
run: uv run sphinx-build ${GITHUB_WORKSPACE}/docs _build/html
- uses: ./.github/actions/publish-docs
with:
type: ${{ env.DEPLOYMENT }}
version: ${{ env.VERSION }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
build-wheel:
needs: build-and-test
if: ${{ startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[wheel]') }}
uses: ./.github/workflows/wheels.yml
publish:
needs: build-wheel
runs-on: ubuntu-latest
permissions:
id-token: write
if: ${{ startsWith(github.ref, 'refs/tags') }}
steps:
- name: Download wheel files
uses: actions/download-artifact@v4
with:
path: dist
pattern: snapatac2-*
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# build-docker:
# needs: [build-and-test, build-wheel]
# if: ${{ startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[docker]') }}
# runs-on: ubuntu-latest
# steps:
# - name: Docker
# uses: ./.github/actions/build-docker-image
# with:
# snapatac2-version: ${{ needs.build-and-test.outputs.VERSION }}
# python-version: 3.11
# username: ${{ secrets.dockerhub_username }}
# password: ${{ secrets.dockerhub_token }}