summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2020-05-23 20:08:57 -0700
committerDavid Lord <davidism@gmail.com>2020-05-23 21:45:59 -0700
commit5c6fcad45cf80a56a609482afc5c17d51277e993 (patch)
tree8d3b85aa4fff6a4c1c5519e2f21acb67e40a3bb1
parentbddffe65cd5428fffdf3be0af5d9f2f766933d3e (diff)
downloadmarkupsafe-5c6fcad45cf80a56a609482afc5c17d51277e993.tar.gz
use GitHub Actions for CI
-rw-r--r--.azure-pipelines.yml81
-rw-r--r--.github/workflows/build.yaml28
-rw-r--r--.github/workflows/tests.yaml52
-rw-r--r--setup.py5
4 files changed, 84 insertions, 82 deletions
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
deleted file mode 100644
index c956714..0000000
--- a/.azure-pipelines.yml
+++ /dev/null
@@ -1,81 +0,0 @@
-trigger:
- branches:
- include:
- - master
- - '*.x'
- tags:
- include:
- - '*'
-
-jobs:
- - job: Test
-
- variables:
- vmImage: 'ubuntu-latest'
- python.version: '3.8'
- TOXENV: 'py'
-
- strategy:
- matrix:
- Python 3.8 Linux:
- vmImage: 'ubuntu-latest'
- Python 3.8 Windows:
- vmImage: 'windows-latest'
- Python 3.8 Mac:
- vmImage: 'macos-latest'
- PyPy 3 Linux:
- python.version: 'pypy3'
- Python 3.7 Linux:
- python.version: '3.7'
- Python 3.6 Linux:
- python.version: '3.6'
- Docs:
- TOXENV: 'docs'
- Style:
- TOXENV: 'style'
-
- pool:
- vmImage: $[ variables.vmImage ]
-
- steps:
- - task: UsePythonVersion@0
- inputs:
- versionSpec: $(python.version)
- displayName: Use Python $(python.version)
-
- - script: pip --disable-pip-version-check install -U tox
- displayName: Install tox
-
- - script: tox
- displayName: Run tox
-
- - job: Build
- dependsOn: Test
- condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['Build.Reason'], 'Manual'))
-
- variables:
- CIBW_SKIP: 'cp27-* pp27-* cp35-*'
-
- strategy:
- matrix:
- Linux:
- vmImage: 'ubuntu-latest'
- Windows:
- vmImage: 'windows-latest'
- Mac:
- vmImage: 'macos-latest'
-
- pool:
- vmImage: $[ variables.vmImage ]
-
- steps:
- - task: UsePythonVersion@0
- displayName: Use Python
-
- - script: pip install cibuildwheel
- displayName: Install cibuildwheel
-
- - script: cibuildwheel --output-dir wheels .
- displayName: Run cibuildwheel
-
- - publish: 'wheels'
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 0000000..17581fa
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,28 @@
+name: Build
+on:
+ push:
+ branches:
+ - master
+ - '*.x'
+ tags:
+ - '*'
+jobs:
+ wheels:
+ name: ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ env:
+ CIBW_SKIP: 'cp27-* pp27-* cp35-*'
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ python-version: '3.8'
+ - run: pip install cibuildwheel
+ - run: cibuildwheel
+ - uses: actions/upload-artifact@v2
+ with:
+ path: ./wheelhouse
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
new file mode 100644
index 0000000..4c457e1
--- /dev/null
+++ b/.github/workflows/tests.yaml
@@ -0,0 +1,52 @@
+name: Tests
+on:
+ push:
+ branches:
+ - master
+ - '*.x'
+ pull_request:
+ branches:
+ - master
+ - '*.x'
+jobs:
+ tests:
+ name: ${{ matrix.name }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - {name: Linux, python: '3.8', os: ubuntu-latest, tox: py38}
+ - {name: Windows, python: '3.8', os: windows-latest, tox: py38}
+ - {name: Mac, python: '3.8', os: macos-latest, tox: py38}
+ - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
+ - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
+ - {name: 'PyPy', python: pypy3, os: ubuntu-latest, tox: pypy3}
+ - {name: Style, python: '3.8', os: ubuntu-latest, tox: style}
+ - {name: Docs, python: '3.8', os: ubuntu-latest, tox: docs}
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+ - name: update pip
+ run: |
+ pip install -U wheel
+ pip install -U setuptools
+ python -m pip install -U pip
+ - name: get pip cache dir
+ id: pip-cache
+ run: echo "::set-output name=dir::$(pip cache dir)"
+ - name: cache pip
+ uses: actions/cache@v1
+ with:
+ path: ${{ steps.pip-cache.outputs.dir }}
+ key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}
+ - name: cache pre-commit
+ uses: actions/cache@v1
+ with:
+ path: ~/.cache/pre-commit
+ key: pre-commit|${{ matrix.python }}|${{ hashFiles('.pre-commit-config.yaml') }}
+ if: matrix.tox == 'style'
+ - run: pip install tox
+ - run: tox -e ${{ matrix.tox }}
diff --git a/setup.py b/setup.py
index 9ef2acd..2a8743f 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,4 @@
+import os
import platform
import sys
from distutils.errors import CCompilerError
@@ -51,7 +52,9 @@ def show_message(*lines):
print("=" * 74)
-if platform.python_implementation() not in {"PyPy", "Jython"}:
+if os.environ.get("CIBUILDWHEEL", "0") == "1":
+ run_setup(True)
+elif platform.python_implementation() not in {"PyPy", "Jython"}:
try:
run_setup(True)
except BuildFailed: