update document #156
This file contains 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-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 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.10' | |
- uses: ./.github/actions/setup-rust | |
with: | |
cache: true | |
- name: Install dependencies | |
run: | | |
pip install --user --upgrade pip | |
pip install --user pytest hypothesis==6.72.4 wheel | |
- name: Build Python package | |
run: | | |
cd ${GITHUB_WORKSPACE}/snapatac2-python | |
pip install --user . | |
pytest tests | |
- uses: ./.github/actions/build-docs | |
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: kaizhang/SnapATAC2/.github/workflows/wheels.yml@main | |
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/[email protected] | |
# 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 }} |