Skip to content

Commit

Permalink
update ci (#26)
Browse files Browse the repository at this point in the history
* [azp] add py 3.8 and 3.9, run demos in 3.9

* [travis] add 3.8, 3.9, remove macOS

* [gha] add GitHub Actions builds

* fix mypy unresolved imports

* drop 3.5 from CI builds
  • Loading branch information
svenevs committed Aug 20, 2021
1 parent 1b7b4fc commit 541bc3e
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 77 deletions.
36 changes: 24 additions & 12 deletions .azure-pipelines.yml
Expand Up @@ -23,61 +23,73 @@ schedules:

jobs:
######################################################################################
# Linux :: Python :: 3.5, 3.6, 3.7 #
# Linux :: Python :: 3.6, 3.7, 3.8, 3.9 #
######################################################################################
- job: Linux_Python
pool:
vmImage: 'ubuntu-latest'
steps:
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.5
py_version: 3.6
image_short: Linux
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.6
py_version: 3.7
image_short: Linux
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.7
py_version: 3.8
image_short: Linux
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.9
image_short: Linux
######################################################################################
# macOS :: Python :: 3.5, 3.6, 3.7 #
# macOS :: Python :: 3.6, 3.7, 3.8, 3.9 #
######################################################################################
- job: macOS_Python
pool:
vmImage: 'macos-latest'
steps:
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.5
py_version: 3.6
image_short: macOS
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.6
py_version: 3.7
image_short: macOS
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.7
py_version: 3.8
image_short: macOS
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.9
image_short: macOS
######################################################################################
# Win64 :: Python :: 3.5, 3.6, 3.7 #
# Win64 :: Python :: 3.6, 3.7, 3.8, 3.9 #
######################################################################################
- job: Win64_Python
pool:
vmImage: 'windows-latest'
steps:
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.5
py_version: 3.6
image_short: Win64
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.6
py_version: 3.7
image_short: Win64
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.7
py_version: 3.8
image_short: Win64
- template: .ci/test_python_and_upload.yml
parameters:
py_version: 3.9
image_short: Win64
######################################################################################
# Linux :: Demos #
Expand Down
4 changes: 2 additions & 2 deletions .ci/run_demos.yml
Expand Up @@ -4,9 +4,9 @@ parameters:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
versionSpec: 3.9
architecture: 'x64'
displayName: Use Python 3.7
displayName: Use Python 3.9
- script: |
pip install -U tox codecov coverage
displayName: Install Dependencies
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/run_demos.yml
@@ -0,0 +1,46 @@
name: Run Demos
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install -U tox codecov coverage
##################################################################################
# Each new demo: add new script: here, and in Demos Full Coverage below. #
##################################################################################
- name: Demo custom_log_stage
run: |
tox -q -e demos -- custom_log_stage
##################################################################################
# Run the demos with the --animate flag to complete coverage analysis. The
# console clearing may produce some odd artifacts in the logs online (`[H` shows
# up), aka IGNORE the output here ;). Then run some extras / generate
# coverage.xml report.
- name: Demos Full Coverage (IGNORE)
run: |
tox -e demos -- custom_log_stage --animate
coverage run -a demos/ --help
# Coverage `run -p` creates .coverage.*** files for different processes.
# Combine them back into one file.
coverage combine -a .
coverage xml -o coverage.xml
- name: Upload Code Coverage for Demos
run: |
codecov --required -X gcov -f coverage.xml --name "[GHA] Linux ${{ matrix.python-version }}-Demos"
34 changes: 34 additions & 0 deletions .github/workflows/test_python_and_upload.yml
@@ -0,0 +1,34 @@
name: Test Python
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install -U tox codecov coverage
- name: Run Tests for ${{ matrix.python-version }}
run: |
tox -e py -- --cov-report xml:coverage.xml --cov
# This step doesn't seem to be necessary...but meh xD
- name: Delete ${{ matrix.python-version }} .tox/ Directory
run: |
python -c "import shutil; shutil.rmtree('.tox', ignore_errors=True)"
- name: Upload Code Coverage for ${{ matrix.python-version }}
run: |
codecov --required -X gcov -f coverage.xml --name "[GHA] Linux-${{ matrix.python-version }}"
75 changes: 13 additions & 62 deletions .travis.yml
@@ -1,5 +1,10 @@
sudo: false
dist: xenial
os: linux
dist: focal
group: edge
arch: arm64-graviton2
virt: lxd
language: python

# Only build master branch, other branches will have a Pull Request build.
branches:
Expand All @@ -8,71 +13,17 @@ branches:

matrix:
include:
- os: linux
# NOTE: by using `python`, we automatically get put in a virtual environment.
# (relevant for after_success here).
language: python
python: 3.7
services:
- docker
before_install:
- docker pull python:3.5.0
- docker run -itd --name py350 python:3.5.0 /bin/sh
- docker cp . py350:/data
install:
- docker exec py350 pip install -U pip
- docker exec py350 pip install tox
script:
- docker exec --workdir /data py350 tox -e py -- --cov-report xml:coverage.xml --cov
- docker cp py350:/data/coverage.xml .
- docker stop py350
after_success:
- pip install codecov
- codecov --required -X gcov -f coverage.xml --name "[Travis] docker-py3.5.0"
env: PY=3.5.0
- os: linux
# NOTE: using language: generic on xenial to specifically get 3.5.2, which
# does not have NoReturn in typing. Acquiring 3.5.0 on Ubuntu is
# challenging even to build from source due to OpenSSL ABI changes.
language: generic
addons:
apt:
packages:
- python3.5
- python3.5-dev
- python3.5-venv
before_install:
- python3 -m venv venv
- source venv/bin/activate
env: PY=3.5
- os: linux
language: python
python: 3.6
- python: 3.6
env: PY=3.6
- os: linux
language: python
python: 3.7
- python: 3.7
env: PY=3.7
- python: 3.8
env: PY=3.8
- python: 3.9
env: PY=3.9
- os: linux
language: python
python: 3.8-dev
env: PY=3.8-dev
- os: osx
language: generic
env: PY=3.x
before_install:
- |
if brew ls --versions python >/dev/null 2>&1; then
action="upgrade"
else
action="install"
fi
HOMEBREW_NO_AUTO_UPDATE=1 brew $action python
python3 -m venv venv
source venv/bin/activate
- os: linux
language: python
python: 3.7
python: 3.9
env: TEST=lint
script:
- tox -e lint
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_extensions/youtube.py
Expand Up @@ -44,7 +44,7 @@

from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst.directives import positive_int
from docutils.parsers.rst.directives import positive_int # type: ignore


class Youtube(nodes.General, nodes.Element):
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Expand Up @@ -34,6 +34,8 @@ skip_install = false
deps =
mypy
pytest-mypy
types-docutils
types-Pygments
commands =
mypy --version
pytest --mypy -m mypy ci_exec/ docs/ tests/
Expand Down

0 comments on commit 541bc3e

Please sign in to comment.