Try Github Actions (#1843)

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
new file mode 100644
index 0000000..17f0d55
--- /dev/null
+++ b/.github/workflows/check.yml
@@ -0,0 +1,82 @@
+name: check
+on:
+  push:
+  pull_request:
+
+jobs:
+  lint:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - uses: actions/setup-python@v2
+    - name: set PY
+      run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
+    - uses: actions/cache@v2
+      with:
+        path: ~/.cache/pre-commit
+        key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
+    - uses: pre-commit/action@v1.1.0
+
+  test:
+    name: ${{ matrix.os }} - ${{ matrix.py }}
+    runs-on: ${{ matrix.os }}-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        os:
+        - Ubuntu
+        - Windows
+        - MacOs
+        py:
+        - 3.8
+        - 3.7
+        - 3.6
+        - 2.7
+        - pypy2
+        - pypy3
+
+    steps:
+    - uses: actions/checkout@v2
+    - uses: tox-dev/action@v1.0.0
+      with:
+        python-version: ${{ matrix.py }}
+
+    - name: setup python for tox
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.8
+    - name: install tox
+      run: python -m pip install tox
+    - name: setup python for test ${{ matrix.py }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.py }}
+    - name: setup test suite for ${{ matrix.os }}-${{ matrix.py }}
+      run: tox -vve py --notest
+    - name: run test suite for ${{ matrix.os }}-${{ matrix.py }}
+      run: tox -e py
+
+  check:
+    name: check ${{ matrix.tox_env }}
+    runs-on: Ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        tox_env:
+        - readme
+        - upgrade
+        - dev
+        - zipapp
+        - docs
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: setup Python 3.8
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.8
+    - name: install tox
+      run: python -m pip install tox
+    - name: run check for ${{ matrix.tox_env }}
+      run: python -m tox -e ${{ matrix.tox_env }}
diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
new file mode 100644
index 0000000..9002cce
--- /dev/null
+++ b/.github/workflows/publish.yaml
@@ -0,0 +1,17 @@
+name: publish
+on:
+  push:
+    branches-ignore:
+      - "*"
+    tags:
+      - "*"
+
+jobs:
+  publish:
+    runs-on: ubuntu-latest
+    steps:
+    - name: publish to PyPi
+      uses: pypa/gh-action-pypi-publish@master
+      with:
+        user: __token__
+        password: ${{ secrets.pypi_password }}
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
deleted file mode 100644
index 2381fb9..0000000
--- a/azure-pipelines.yml
+++ /dev/null
@@ -1,134 +0,0 @@
-name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
-resources:
-  repositories:
-  - repository: tox
-    type: github
-    endpoint: github-gb
-    name: tox-dev/azure-pipelines-template
-    ref: master
-
-trigger:
-  batch: true
-  branches:
-    include:
-    - master
-    - legacy
-    - refs/tags/*
-
-pr:
-  branches:
-    include:
-    - '*'
-
-schedules:
-- cron: "12 0 * * *"
-  displayName: Daily build
-  branches:
-    include: [ master, rewrite ]
-  always: true
-
-variables:
-  PYTEST_ADDOPTS: "-vv --durations=20"
-  CI_RUN: 'yes'
-  UPGRADE_ADVISORY: 'yes'
-
-jobs:
-- template: run-tox-env.yml@tox
-  parameters:
-    jobs:
-      py39:
-        image: [linux]
-      py38:
-        image: [linux, vs2017-win2016, macOs]
-      py37:
-        image: [linux, vs2017-win2016, macOs]
-      py36:
-        image: [linux, vs2017-win2016, macOs]
-      py35:
-        image: [linux, vs2017-win2016, macOs]
-      py27:
-        image: [linux, windows, macOs]
-      pypy:
-        image: [linux, windows, macOs]
-      pypy3:
-        image: [linux, windows, macOs]
-      homebrew_py3:
-        image: [macOs]
-        py: brew@python3
-        toxenv: py37
-      homebrew_py2:
-        image: [macOs]
-        py: brew@python2
-        toxenv: py27
-      fix_lint:
-        image: [linux, windows]
-      docs:
-        image: [linux, windows]
-      readme:
-        image: [linux, windows]
-      upgrade:
-        image: [linux, windows]
-      dev: null
-      zipapp:
-        image: [linux, windows]
-        after:
-          - task: CopyFiles@2
-            displayName: move generated zipapp
-            condition: eq(variables['image_name'], 'linux')
-            inputs:
-              sourceFolder: $(System.DefaultWorkingDirectory)
-              contents: |
-                virtualenv.pyz
-              targetFolder: $(Build.StagingDirectory)
-          - task: PublishBuildArtifacts@1
-            displayName: publish zipapp
-            condition: eq(variables['image_name'], 'linux')
-            inputs:
-              pathtoPublish: $(Build.ArtifactStagingDirectory)
-              ArtifactName: virtualenv.pyz
-    before:
-      - script: '$(toxPython.pythonLocation)/python -m pip install "virtualenv < 20"'
-        displayName: pypy3 tox needs fix to accomodate separate bin and Script
-        condition: and(succeeded(), eq(variables['image_name'], 'windows'), in(variables['TOXENV'], 'pypy3'))
-      - script: '$(toxPython.pythonLocation)/python -m pip install .'
-        displayName: tox uses this virtualenv (eat our own dogfood)
-        condition: not(and(succeeded(), eq(variables['image_name'], 'windows'), in(variables['TOXENV'], 'pypy3')))
-      - script: 'sudo apt-get update -y && sudo apt-get install fish csh'
-        condition: and(succeeded(), eq(variables['image_name'], 'linux'), in(variables['TOXENV'], 'py39', 'py38', 'py37', 'py36', 'py35', 'py27', 'pypy', 'pypy3'))
-        displayName: install fish and csh via apt-get
-      - script: 'brew update -vvv && brew install fish tcsh'
-        condition: and(succeeded(), eq(variables['image_name'], 'macOs'), in(variables['TOXENV'], 'py39', 'py38', 'py37', 'py36', 'py35', 'py27', 'pypy', 'pypy3'))
-        displayName: install fish and csh via brew
-      - task: UsePythonVersion@0
-        condition: and(succeeded(), in(variables['TOXENV'], 'py39', 'py38', 'py37', 'py36', 'py35'))
-        displayName: provision cpython 2
-        inputs:
-          versionSpec: '2.7'
-      - task: UsePythonVersion@0
-        condition: and(succeeded(), in(variables['TOXENV'], 'py27'))
-        displayName: provision cpython 3
-        inputs:
-          versionSpec: '3.8'
-      - task: UsePythonVersion@0
-        condition: and(succeeded(), in(variables['TOXENV'], 'pypy'))
-        displayName: provision pypy 3
-        inputs:
-          versionSpec: 'pypy3'
-      - task: UsePythonVersion@0
-        condition: and(succeeded(), in(variables['TOXENV'], 'pypy3'))
-        displayName: provision pypy 2
-        inputs:
-          versionSpec: 'pypy2'
-      - script: choco install vcpython27 --yes -f
-        condition: and(succeeded(), eq(variables['image_name'], 'windows'), in(variables['TOXENV'], 'py27', 'pypy'))
-        displayName: Install Visual C++ for Python 2.7
-    coverage:
-      with_toxenv: 'coverage' # generate .tox/.coverage, .tox/coverage.xml after test run
-      for_envs: [py39, py38, py37, py36, py35, py27, pypy, pypy3]
-
-- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
-  - template: publish-pypi.yml@tox
-    parameters:
-      external_feed: 'gb'
-      pypi_remote: 'pypi-gb'
-      dependsOn: [fix_lint, docs, report_coverage, dev, readme, zipapp, upgrade]