Repository: pipxproject/pipx (python)

Issue:
Use Github Actions instead of Travis on push
**How would this feature be useful?**
<!-- Describe any use cases this solves or frustrations it alleviates.   -->
We could use native Github Actions to do the same push-triggered verifications that we currently do using Travis CI.

It would remove Travis from our flow, removing one more moving part, and keeping all committing actions within Github, which seems more reliable to me.

It would also make it easier for us to in the future integrate other actions, such as doing a lot of housekeeping on a release.  For example on a Github release, we could rebuild the docs and publish them, and submit to PyPI.

**Describe the solution you'd like**
<!-- If you have an idea of how to do this, write it here! -->
I have a branch in my repo up and running using Github Actions that currently replicates our Travis CI
push-triggered verifications and tests.
https://github.com/itsayellow/pipx/tree/github-actions

**Describe alternatives you've considered**
<!-- If there's some workaround or alternative solutions, let us know. -->
We don't strictly speaking **need** to do this, the current Travis verifications work.  But I thought this might conceptually be simpler, and thought I'd submit it for discussion since I have it completely implemented and it would be ready to drop in now as a PR.

Pull request:
GitHub Actions for CI
<!---
Thank you for your soon-to-be pull request. Before you submit this, please
double check to make sure that you've added an entry to docs/changelog.md.
-->
Closes #440 

This replicates our Travis CI on-push verifications and adds a macos target.

Patch:
diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml
new file mode 100644
index 0000000..d5d4d8e
--- /dev/null
+++ b/.github/workflows/on-push.yml
@@ -0,0 +1,84 @@
+# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Test
+
+on:
+    pull_request:
+    push:
+    release:
+
+jobs:
+  lint:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [3.7]
+
+    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 native-venv version of nox
+      run: |
+        python -m pip install --upgrade pip
+        pip install git+https://github.com/cs01/nox.git@5ea70723e9e6#egg=nox
+    - name: Lint
+      run: |
+        nox --non-interactive --session lint
+
+  docs:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [3.7]
+
+    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 native-venv version of nox
+      run: |
+        python -m pip install --upgrade pip
+        pip install git+https://github.com/cs01/nox.git@5ea70723e9e6#egg=nox
+    - name: Verify Docs
+      run: |
+        nox --non-interactive --session docs
+
+  tests:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+        python-version: [3.6, 3.7, 3.8]
+        include:
+          - os: windows-latest
+            python-version: 3.7
+          - os: macos-latest
+            python-version: 3.7
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Upgrade pip
+      run: python -m pip install --upgrade pip
+    # macos: Install wheel to allow wheel-building for nox and regex
+    # Build regex wheel into pip cache, so future pipx installs don't compile.
+    # This avoids future compile errors in nox tests because of missing
+    #   header files.
+    - name: Install wheel and build wheel for regex to pip cache
+      if: ${{ matrix.os == 'macos-latest' }}
+      run: |
+        python -m pip install wheel
+        python -m pip install regex
+    - name: Install native-venv version of nox
+      run: pip install git+https://github.com/cs01/nox.git@5ea70723e9e6#egg=nox
+    - name: Execute Tests
+      run: |
+        nox --non-interactive --session tests-${{ matrix.python-version }}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index af06b11..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-language: python
-os: linux
-cache:
-  pip: true
-matrix:
-  include:
-    - python: "3.6"
-      env: NOXSESSION="tests-3.6"
-    - python: "3.7"
-      env: NOXSESSION="tests-3.7"
-      dist: xenial
-    - python: "3.8"
-      env: NOXSESSION="tests-3.8"
-    - python: "3.7"
-      env: NOXSESSION="lint"
-      dist: xenial
-    - python: "3.7"
-      env: NOXSESSION="docs"
-      dist: xenial
-    - os: windows
-      language: bash
-      env: NOXSESSION="tests-3.7"
-      before_install:
-        - export TRAVIS_PYTHON_VERSION=3.7
-        - choco install python --version $TRAVIS_PYTHON_VERSION
-        - export PATH="/C/Python37:/C/Python37/Scripts:$PATH"
-install:
-  - pip install git+https://github.com/cs01/nox.git@5ea70723e9e6#egg=nox
-
-script:
-  - nox --non-interactive --session "$NOXSESSION"
diff --git a/README.md b/README.md
index bb89692..63a4992 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
 </p>
 
 <p align="center">
-<a href="https://travis-ci.org/pipxproject/pipx"><img src="https://travis-ci.org/pipxproject/pipx.svg?branch=master" /></a>
+<a href="https://github.com/pipxproject/pipx/actions?query=workflow%3ATest"><img src="https://github.com/pipxproject/pipx/workflows/Test/badge.svg?branch=master"></a>
 <a href="https://badge.fury.io/py/pipx"><img src="https://badge.fury.io/py/pipx.svg" alt="PyPI version" height="18"></a>
 </p>
 


Test patch:
diff --git a/tests/test_animate.py b/tests/test_animate.py
index 41c3ba3..9065881 100644
--- a/tests/test_animate.py
+++ b/tests/test_animate.py
@@ -18,7 +18,7 @@ def check_animate_output(
     chars_to_test = 1 + len("".join(frame_strings[:frames_to_test]))
 
     with pipx.animate.animate(test_string, do_animation=True):
-        time.sleep(frame_period * (frames_to_test - 1) + 0.5)
+        time.sleep(frame_period * (frames_to_test - 1) + 0.6)
     captured = capsys.readouterr()
 
     assert captured.err[:chars_to_test] == expected_string[:chars_to_test]
diff --git a/tests/test_shared_libs.py b/tests/test_shared_libs.py
index 365fecd..5feeddb 100644
--- a/tests/test_shared_libs.py
+++ b/tests/test_shared_libs.py
@@ -10,8 +10,8 @@ now = time.time()
 @pytest.mark.parametrize(
     "mtime,needs_upgrade",
     [
-        (now - shared_libs.SHARED_LIBS_MAX_AGE_SEC - 600, True),
-        (now - shared_libs.SHARED_LIBS_MAX_AGE_SEC + 600, False),
+        (now - shared_libs.SHARED_LIBS_MAX_AGE_SEC - 20 * 60, True),
+        (now - shared_libs.SHARED_LIBS_MAX_AGE_SEC + 20 * 60, False),
     ],
 )
 def test_auto_update_shared_libs(capsys, pipx_temp_env, mtime, needs_upgrade):