Repository: ihmeuw/vivarium_public_health (language: python)

Issue:
Add workflow_dispatch to actions



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..6f3ad54fe
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,67 @@
+# -----------------------------------------------------------------------------
+#   Continuous Intergration for Vivarium Public Health
+#   - invoked on push and pull_request
+#   - test under 3 versions of python
+#   - look for an upstream (vivarium) branch and use it if it exists
+# -----------------------------------------------------------------------------
+name: build
+on:
+  push:
+    branches:
+      - '*'
+    tags-ignore:
+      - v*
+  pull_request:
+    branches:
+      - '*'
+    tags-ignore:
+      - v*
+
+  # Run this workflow manually from the Actions tab.
+  workflow_dispatch:
+  
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [3.6, 3.7, 3.8]
+    defaults:
+      run:
+        shell: bash -l {0}
+    steps:
+      - uses: actions/checkout@v2
+      - 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: Conda info
+        run: |
+          conda info
+          conda list
+          echo GITHUB_HEAD_REF = ${GITHUB_HEAD_REF}
+      - name: check for upstream branch
+        run: |
+          if git ls-remote --exit-code --heads https://github.com/ihmeuw/vivarium.git ${GITHUB_HEAD_REF} == "0"; then
+            echo "upstream_exist=true" >> $GITHUB_ENV
+          else
+            echo "upstream_exist=false" >> $GITHUB_ENV
+          fi
+      - name: print environment values
+        run: |
+          cat $GITHUB_ENV
+      - name: Retrieve upstream branch if exists
+        if: env.upstream_exist == 'true'
+        run: |
+          echo "Cloning upstream branch: ${GITHUB_HEAD_REF}"
+          git clone --branch=${GITHUB_HEAD_REF} https://github.com/ihmeuw/vivarium.git
+          pushd vivarium
+          pip install .
+          popd
+      - name: Install dependencies
+        run: |
+          pip install .[dev]
+      - name: Test
+        run: |
+          pytest ./tests
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 000000000..2daf3c8ff
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,45 @@
+name: deploy
+
+on:
+  push:
+    tags:
+      - v*
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [ 3.6, 3.7, 3.8 ]
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install .[dev]
+      - name: Test
+        run: |
+          pytest ./tests
+  deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: '3.x'
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install setuptools wheel twine
+      - name: Build and publish
+        env:
+          TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
+          TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+        run: |
+          python setup.py sdist bdist_wheel
+          twine upload dist/*
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 1437cbce9..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-language: python
-python:
-  - 3.6
-
-os: linux
-
-before_install:
-  - ./ci/travis-before-install.sh
-script:
-  - ./ci/travis-test.sh
-deploy:
-  provider: pypi
-  username: vivarium
-  password:
-    secure: LpC+hYEM9WhK4kxduQK69bre4SP4qF0KbXpcbAOHqYJIbsHMcB6fdEQ1p3Xh18w5Hm6Dr3heV+TJswvKXRPR48GZLhyoJkhTu+5eETLUB6dzqMEBuWPM2mqgeCuXf4npWtT4RDCPmNWz9uNe4u8QDWiwWGsVX8/kW189fmEQhvCb17ilEw3ji2o0vvUbWYuEwl5nEFnbAEBWA/1MyykNlc936Fy3rs+ZG87/r+e6NNMrQ00cCw0TaWF5T4Y2Akc3QkgL8Y4GQLgsZIrtrJMkfdPrHONOmblkprRlHslOLaLyZCN6NhVY5MAxymPpbTAVhUH0g800JpI3MiAoPTvw65Qni7jXsfG/MIHWiAvP4w0IJv/K7t7KSNc9FXSeYO4B2shJxNmhb/VlMGxHWAER4elPmBb1azTddZQJRz881VILuCg30bDJo4pWcHbUAJJ8hfnslmfYrg8MCxoQh9cqqXElMiwRqKidoxZQX/A+iUOrrZHCBMPXN5OON6FX6tF3eVhoXh+s6J76XqwxnPW366OiMa11Wx0CVcnptuDYmBZtkCB5WNEA+FULeHY6KTGBL0QSlyzpuoM+GsKM7/FC0/rtIjG6QPPHYBieXY3VDdLijSFY1GvT8HRhboATe9Xt9Mtdulqh6EFDwC/sdl7CffDZT6J8qYFRWaP25oaIxLs=
-  distributions: sdist bdist_wheel
-  on:
-    repo: ihmeuw/vivarium_public_health
-    tags: true
diff --git a/ci/travis-before-install.sh b/ci/travis-before-install.sh
deleted file mode 100755
index 73476d749..000000000
--- a/ci/travis-before-install.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-
-uname -a
-free -m
-df -h
-ulimit -a
-mkdir builds
-pushd builds
-
-# Build into our own virtualenv
-pip install -U virtualenv
-
-virtualenv --python=python venv
-
-source venv/bin/activate
-python -V
-
-pip install --upgrade pip setuptools
-
-# For push builds, TRAVIS_BRANCH is the branch name
-# For builds triggered by PR, TRAVIS_BRANCH is the branch targeted by the PR
-branch=$TRAVIS_BRANCH
-echo branch ${branch}
-
-# Look for branch in upstream repositories
-# branch is the "target", either same name for push or target for PR
-upstream_branch_exists="$(git ls-remote --heads https://github.com/ihmeuw/vivarium.git ${branch})"
-
-# if there is a match for upstream, use that
-if [ ! -z "${upstream_branch_exists}" ]  # checks if not-empty
-then
-    echo upstream branch found for ${branch}
-    # clone and install upstream stuff if target branch exists
-    git clone --branch=$branch https://github.com/ihmeuw/vivarium.git
-    pushd vivarium
-    pip install .
-    popd
-else
-    echo no upstream branch found
-fi
-
-popd
-
-# If no upstream match was found, this will install last release
-pip install .[test,docs]
diff --git a/setup.py b/setup.py
index 48ef75f95..3394a84ee 100644
--- a/setup.py
+++ b/setup.py
@@ -18,12 +18,10 @@
 
     install_requirements = [
         'vivarium>=0.10.0',
-        # FIXME: Newer versions of numpy have conflicting dependencies with pytables.
-        'numpy<=1.15.4',
-        'pandas>=0.24.0,<0.25',
+        'numpy',
+        'pandas',
         'scipy',
-        # FIXME: Requirement imposed by our standard data sources.
-        'tables<=3.4.0',
+        'tables',
         'risk_distributions>=2.0.3',
     ]
 


Test patch:
diff --git a/ci/travis-test.sh b/ci/travis-test.sh
deleted file mode 100755
index 18cc3f9b7..000000000
--- a/ci/travis-test.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-source builds/venv/bin/activate
-pytest tests/