From af8a7ee0687a643690e1daaa1f915daadf06c821 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 5 Oct 2021 17:31:24 +0200 Subject: [PATCH] Switch to GHA. --- .github/workflows/build.yml | 75 +++++++++++++++++++++++ README.rst | 7 +-- azure-pipelines.yml | 115 ------------------------------------ 3 files changed, 77 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..da42f2ab --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-18.04, macos-10.15, windows-2019] + python-version: ["3.7", "3.8", "3.9"] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Build & install + shell: bash + run: | + set -x + + python -mpip install --upgrade pip setuptools && + + case "$(python -c 'import sys; print(sys.platform)')" in + linux) + sudo PY_VERS="${{ matrix.python-version }}" tools/build-manylinux-wheel.sh && + sudo apt update && + sudo apt install ghostscript inkscape \ + texlive-latex-{base,recommended,extra} texlive-fonts-recommended cm-super dvipng && + pip install 'pycairo<1.20' # 1.20 requires too-recent cairo for Ubuntu 16.04. + ;; + darwin) + # Don't install inkscape: building it from source is a bit silly. + export HOMEBREW_NO_INSTALL_CLEANUP=1 && + brew install cairo pkg-config && + PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig tools/build-macos-wheel.sh && + brew install ghostscript + ;; + win32) + # Don't install inkscape (see note in run-mpl-test-suite.py). + # Skip known-bad version of numpy. + git clone --depth 1 https://github.com/anntzer/pycairo-windows-wheels && + python -mpip install --find-links pycairo-windows-wheels --prefer-binary pycairo && + python tools/build-windows-wheel.py && + choco install --no-progress ghostscript && + pip install 'numpy!=1.19.4' + ;; + *) + exit 1 + ;; + esac && + + python -mpip install dist/*.whl && + python tools/ensure-mpl-test-data.py && + # pytest 6.2 is incompatible with matplotlib<3.4 + # pytest-{instafail,timeout} useful for hanging tests. + python -mpip install 'pytest<6.2' pytest-instafail pytest-timeout + - name: Test + shell: bash + run: | + set -x && + python -mpip list && + # Skip tests triggering to-be-investigated fatal error on Windows :( + ( + if [[ "$(python -c 'import sys; print(sys.platform)')" != win32 ]]; then + ./run-mpl-test-suite.py --tolerance=50 --instafail --timeout=300 --capture=no --verbose + fi + ) && + PYTHONFAULTHANDLER=1 PYTHONIOENCODING=utf-8 ./run-examples.py + - uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist/*.whl + if: ${{ always() }} diff --git a/README.rst b/README.rst index 739bc2bb..a309595d 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ A (new) cairo backend for Matplotlib ==================================== -| |GitHub| |PyPI| |Fedora Rawhide| |Azure Pipelines| +| |GitHub| |PyPI| |Fedora Rawhide| .. |GitHub| image:: https://img.shields.io/badge/github-anntzer%2Fmplcairo-brightgreen @@ -13,9 +13,6 @@ A (new) cairo backend for Matplotlib .. |Fedora Rawhide| image:: https://repology.org/badge/version-for-repo/fedora_rawhide/python:mplcairo.svg?header=Fedora%20Rawhide :target: fedora-package_ -.. |Azure Pipelines| - image:: https://img.shields.io/azure-devops/build/matplotlib/86ce5a4c-000c-483c-88a3-8b5612c62517/3 - :target: https://dev.azure.com/matplotlib/mplcairo/_build/latest?definitionId=3 .. _fedora-package: https://src.fedoraproject.org/rpms/python-mplcairo @@ -203,7 +200,7 @@ Windows The following additional dependencies are required: - VS2019 (The exact minimum version is unknown, but it is known that mplcairo - fails to build on the Azure ``vs2017-win2016`` agent and requires the + fails to build on the Github Actions ``windows-2016`` agent and requires the ``windows-2019`` agent.) - cairo headers and import and dynamic libraries (``cairo.lib`` and diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index f5df38ae..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,115 +0,0 @@ -strategy: - matrix: - Linux_py37: - vmImage: 'ubuntu-16.04' - pythonVersion: '3.7' - Linux_py38: - vmImage: 'ubuntu-16.04' - pythonVersion: '3.8' - Linux_py39: - vmImage: 'ubuntu-16.04' - pythonVersion: '3.9' - macOS_py37: - vmImage: 'macOS-10.14' - pythonVersion: '3.7' - macOS_py38: - vmImage: 'macOS-10.14' - pythonVersion: '3.8' - macOS_py39: - vmImage: 'macOS-10.14' - pythonVersion: '3.9' - Windows_py37: - vmImage: 'windows-2019' - pythonVersion: '3.7' - Windows_py38: - vmImage: 'windows-2019' - pythonVersion: '3.8' - Windows_py39: - vmImage: 'windows-2019' - pythonVersion: '3.9' - -pool: - vmImage: '$(vmImage)' - -steps: - -- task: UsePythonVersion@0 - inputs: - versionSpec: '$(pythonVersion)' - architecture: 'x64' - -- bash: | - set -x - - python -mpip install --upgrade pip setuptools && - - case "$(python -c 'import sys; print(sys.platform)')" in - linux) - sudo PY_VERS="$PYTHONVERSION" tools/build-manylinux-wheel.sh && - sudo apt update && - sudo apt install ghostscript inkscape \ - texlive-latex-{base,recommended,extra} texlive-fonts-recommended cm-super dvipng && - pip install 'pycairo<1.20' # 1.20 requires too-recent cairo for Ubuntu 16.04. - ;; - darwin) - # Don't install inkscape: building it from source is a bit silly. - export HOMEBREW_NO_INSTALL_CLEANUP=1 && - brew install cairo pkg-config && - PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig tools/build-macos-wheel.sh && - brew install ghostscript - ;; - win32) - # Don't install inkscape (see note in run-mpl-test-suite.py). - # Skip known-bad version of numpy. - git clone --depth 1 https://github.com/anntzer/pycairo-windows-wheels && - python -mpip install --find-links pycairo-windows-wheels --prefer-binary pycairo && - python tools/build-windows-wheel.py && - choco install --no-progress ghostscript && - pip install 'numpy!=1.19.4' - ;; - *) - exit 1 - ;; - esac && - - python -mpip install dist/*.whl && - python tools/ensure-mpl-test-data.py && - # pytest 6.2 is incompatible with matplotlib<3.4 - # pytest-{instafail,timeout} useful for hanging tests. - python -mpip install 'pytest<6.2' pytest-instafail pytest-timeout - - displayName: 'Build & install' - -- bash: | - set -x && - python -mpip list && - # Skip tests triggering to-be-investigated fatal error on Windows :( - ( - if [[ "$(python -c 'import sys; print(sys.platform)')" != win32 ]]; then - ./run-mpl-test-suite.py --tolerance=50 \ - --instafail --timeout=300 --capture=no --verbose --junitxml=junit/test-results.xml - fi - ) && - PYTHONFAULTHANDLER=1 PYTHONIOENCODING=utf-8 ./run-examples.py - displayName: 'Test' - -- task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(pythonVersion) / $(vmImage)' - condition: succeededOrFailed() - -- bash: | - cp dist/*.whl "$BUILD_ARTIFACTSTAGINGDIRECTORY" - condition: succeededOrFailed() - displayName: 'Copy files' - -- task: PublishBuildArtifacts@1 - inputs: - artifactName: 'wheels' - condition: succeededOrFailed() - -- task: DownloadBuildArtifacts@0 - inputs: - artifactName: 'wheels' - condition: succeededOrFailed()