Fix pulling data doc test #261
Workflow file for this run
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
# ----------------------------------------------------------------------------- | |
# Continuous Intergration for Vivarium Inputs | |
# - invoked on push and pull_request | |
# - test under at least 3 versions of python | |
# - look for upstream branches and use if they exist | |
# ----------------------------------------------------------------------------- | |
name: build | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
defaults: | |
run: | |
shell: bash -le {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: test_env_python${{ matrix.python-version }} | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
- name: Install hdf5 libs | |
run: | | |
sudo apt-get install libhdf5-dev | |
- name: get upstream branch name | |
run: | | |
if "${{ github.event_name == 'pull_request' }}" ; then | |
echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV | |
else | |
echo "branch_name=${GITHUB_REF_NAME}" >> $GITHUB_ENV | |
fi | |
- name: Conda info | |
run: | | |
conda info | |
conda list | |
echo branch_name = ${branch_name} | |
- name: check for upstream vivarium | |
run: | | |
if git ls-remote --exit-code --heads https://github.com/ihmeuw/vivarium.git ${branch_name} == "0"; then | |
echo "upstream_vivarium_exist=true" >> $GITHUB_ENV | |
else | |
echo "upstream_vivarium_exist=false" >> $GITHUB_ENV | |
fi | |
- name: check for upstream vivarium_public_health | |
run: | | |
if git ls-remote --exit-code --heads https://github.com/ihmeuw/vivarium_public_health.git ${branch_name} == "0"; then | |
echo "upstream_vivarium_public_health_exist=true" >> $GITHUB_ENV | |
else | |
echo "upstream_vivarium_public_health_exist=false" >> $GITHUB_ENV | |
fi | |
- name: check for upstream gbd_mapping | |
run: | | |
if git ls-remote --exit-code --heads https://github.com/ihmeuw/gbd_mapping.git ${branch_name} == "0"; then | |
echo "upstream_gbd_mapping_exist=true" >> $GITHUB_ENV | |
else | |
echo "upstream_gbd_mapping_exist=false" >> $GITHUB_ENV | |
fi | |
- name: print environment values | |
run: | | |
cat $GITHUB_ENV | |
- name: Retrieve upstream vivarium | |
if: env.upstream_vivarium_exist == 'true' | |
run: | | |
echo "Cloning vivarium upstream branch: ${branch_name}" | |
git clone --branch=${branch_name} https://github.com/ihmeuw/vivarium.git | |
pushd vivarium | |
pip install . | |
popd | |
- name: Retrieve upstream vivarium_public_health | |
if: env.upstream_vivarium_public_health_exist == 'true' | |
run: | | |
echo "Cloning vivarium_public_health upstream branch: ${branch_name}" | |
git clone --branch=${branch_name} https://github.com/ihmeuw/vivarium_public_health.git | |
pushd vivarium_public_health | |
pip install . | |
popd | |
- name: Retrieve upstream gbd_mapping | |
if: env.upstream_gbd_mapping_exist == 'true' | |
run: | | |
echo "Cloning upstream gbd_mapping branch: ${branch_name}" | |
git clone --branch=${branch_name} https://github.com/ihmeuw/gbd_mapping.git | |
pushd gbd_mapping | |
pip install . | |
popd | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[docs,test] | |
- name: Lint | |
run: | | |
pip install black==22.3.0 isort | |
black . --check --diff | |
isort . --check --verbose --only-modified --diff | |
- name: Test | |
run: | | |
pytest ./tests | |
- name: Doc build | |
run: | | |
make html -C docs/ SPHINXOPTS="-W --keep-going -n" | |
- name: Doctest | |
run: | | |
make doctest -C docs/ |