ci #304
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: ci | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * 1' # weekly | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.8, 3.9, "3.10", 3.11] | |
subdivision: | |
- "test_auxiliary_lib" | |
- "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 | |
pip install tox tox-gh-actions | |
- name: Test with tox | |
run: | | |
export HSTRAT_TESTS_SUBDIVISION=${{ matrix.subdivision }} | |
tox | |
examples: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- 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 | |
coverage: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
subdivision: | |
- "test_auxiliary_lib" | |
- "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.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- 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 | |
python -m pip install -r requirements-dev/py39/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@v3 | |
with: | |
flags: tests # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install apt dependencies | |
run: sudo apt-get install -y rename | |
- uses: actions/checkout@v1 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Test isort tidyness | |
uses: jamescurtin/isort-action@master | |
with: | |
requirementsFiles: "requirements-dev/py38/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-latest | |
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@v1 | |
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-latest | |
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 {} \; | |
python3 -c "import hstrat; print(hstrat.__version__)" | |
# regression test for https://github.com/mmore500/hstrat/commit/c276530 | |
packaging-sdist: | |
runs-on: ubuntu-latest | |
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 {} \; | |
python3 -c "import hstrat; print(hstrat.__version__)" | |
# regression test for https://github.com/mmore500/hstrat/commit/c276530 | |
packaging-source: | |
runs-on: ubuntu-latest | |
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: | |
needs: | |
- coverage | |
- examples | |
- packaging-bdist | |
- packaging-sdist | |
- packaging-source | |
- test | |
- tidy | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements-dev/py38/requirements-release.txt | |
- run: python setup.py sdist bdist_wheel | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |