Skip to content

Optimize downsample-tips, add CLI #1118

Optimize downsample-tips, add CLI

Optimize downsample-tips, add CLI #1118

Workflow file for this run

name: ci
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * 1' # weekly
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
subdivision:
- "test_auxiliary_lib"
- "test_dataframe"
- "test_frozen_instrumentation"
- "test_genome_instrumentation"
- "test_juxtaposition"
- "test_phylogenetic_inference/test_estimators"
- "test_phylogenetic_inference/test_pairwise"
- "test_phylogenetic_inference/test_population"
- "test_phylogenetic_inference/test_priors"
- "test_phylogenetic_inference/test_tree"
- "test_serialization"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_fixed_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_nominal_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_perfect_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_pseudostochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_curbed_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_stochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_policy_evaluators"
- "test_stratum_retention_viz"
- "test_test_drive"
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y ffmpeg -o Acquire::Retries=3
python -m pip install --upgrade pip setuptools
pip install tox tox-gh-actions
- name: Test with tox
run: |
export HSTRAT_TESTS_SUBDIVISION=${{ matrix.subdivision }}
tox
cli:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "requirements-dev/requirements-testing.txt"
- name: Run examples
run: |
python3 -m hstrat
python3 -m hstrat.dataframe.surface_unpack_reconstruct --help
examples:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "requirements-dev/requirements-jit.txt"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "requirements-dev/requirements-testing.txt"
- name: Run examples
run: ./examples/run_all.sh
build-script:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y python3-pybind11 -o Acquire::Retries=3
- run: ./build.sh
coverage:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
subdivision:
- "test_auxiliary_lib"
- "test_dataframe"
- "test_frozen_instrumentation"
- "test_genome_instrumentation"
- "test_juxtaposition"
- "test_phylogenetic_inference/test_estimators"
- "test_phylogenetic_inference/test_pairwise"
- "test_phylogenetic_inference/test_population"
- "test_phylogenetic_inference/test_priors"
- "test_phylogenetic_inference/test_tree"
- "test_serialization"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_fixed_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_nominal_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_perfect_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_pseudostochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_curbed_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_stochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_policy_evaluators"
- "test_stratum_retention_viz"
- "test_test_drive"
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y ffmpeg -o Acquire::Retries=3
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements-dev/py310/requirements-testing.txt
- name: Log coverage configuration
run: coverage debug sys
- name: Run tests with coverage report
run: coverage run -m pytest tests/test_hstrat/${{ matrix.subdivision }}
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
flags: tests # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
tidy:
runs-on: ubuntu-24.04
steps:
- name: Install apt dependencies
run: sudo apt-get install -y rename
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements-dev/py310/requirements-testing.txt
- name: Test isort tidyness
uses: jamescurtin/isort-action@master
with:
requirementsFiles: "requirements-dev/py310/requirements-testing.txt"
- name: Test Black tidyness
uses: psf/black@27d20144a7517594e24a1649451177b2a11284be
with:
version: "22.10.0"
- uses: editorconfig-checker/action-editorconfig-checker@main
- name: Test editorconfig tidyness
run: editorconfig-checker
- name: Test tidy/ tidyness
run: ./tidy/test_tidy.sh
paper:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: joss/paper.md
- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: joss/paper.pdf
# regression test for https://github.com/mmore500/hstrat/commit/c276530
packaging-bdist:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build bdist
run: |
python3 -m venv env
source env/bin/activate
python3 -m pip install -r requirements-dev/requirements-release.txt
python3 setup.py bdist_wheel
tree dist
deactivate
- name: Upgrade pip
run: python3 -m pip install pip --upgrade
- name: Install from bdist
run: python3 -m pip install dist/*.whl
- name: Test install
run: |
find . -type f -name '*.py' -exec rm {} \;
find . -type f -name '*.pyi' -exec rm {} \;
python3 -c "import hstrat; print(hstrat.__version__)"
# regression test for https://github.com/mmore500/hstrat/commit/c276530
packaging-sdist:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build sdist
run: |
python3 -m venv env
source env/bin/activate
python3 -m pip install -r requirements-dev/requirements-release.txt
python3 setup.py sdist
tree dist
deactivate
- name: Upgrade pip
run: python3 -m pip install pip --upgrade
- name: Install from sdist
run: python3 -m pip install dist/*.tar.gz
- name: Test install
run: |
find . -type f -name '*.py' -exec rm {} \;
find . -type f -name '*.pyi' -exec rm {} \;
python3 -c "import hstrat; print(hstrat.__version__)"
# regression test for https://github.com/mmore500/hstrat/commit/c276530
packaging-source:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Upgrade pip
run: python3 -m pip install pip --upgrade
- name: Install from source
run: python3 -m pip install .
- name: Test install
run: |
rm -rf *
cd
python3 -c "import hstrat; print(hstrat.__version__)"
deploy-ghcr:
name: Docker Image Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Tags
id: set_tags
run: |
if [[ "${GITHUB_REF_NAME}" != *merge ]]; then
echo "TAGS=latest,${GITHUB_REF_NAME}" >> $GITHUB_ENV
else
echo "TAGS=latest" >> $GITHUB_ENV
fi
- name: Build and Push to GitHub Container Registry
uses: docker/build-push-action@v1
with:
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ env.TAGS }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
repository: mmore500/hstrat
registry: ghcr.io
add_git_labels: true
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-latest, macos-14]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Ubuntu Dependecies
if: matrix.os == 'ubuntu-24.04'
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y python3.12-dev python3-dev python3-pybind11 -o Acquire::Retries=3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_TEST_COMMAND: python3 -m hstrat.dataframe.surface_unpack_reconstruct --help
CIBW_TEST_SKIP: "*313-* pp* *win* *i686* *musllinux*"
CIBW_SKIP: "*-win32"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
deploy-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev/py310/requirements-release.txt
- name: Build package
run: python setup.py egg_info --tag-build="${{github.run_number}}" sdist bdist_wheel
- name: Test publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Install from test PyPI
run: |
rm -rf *
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ hstrat
- name: Test install
run: |
python3 -c "import hstrat; print(hstrat.__version__)"
deploy:
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build_sdist
- build_wheels
- build-script
- coverage
- cli
- deploy-test
- examples
- packaging-bdist
- packaging-sdist
- packaging-source
- test
- tidy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements-dev/py310/requirements-release.txt
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}