Enable testing on Windows and MacOS (#357)
Co-authored-by: Gleb Nikonorov <gleb.i.nikonorov@gmail.com>
This commit is contained in:
parent
b609a1d914
commit
b9bb5a9b4d
|
@ -16,25 +16,83 @@ on:
|
|||
jobs:
|
||||
build_python:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- name: linting
|
||||
- os: ubuntu-18.04
|
||||
name: linting-ubuntu
|
||||
python-version: 3.6
|
||||
- name: py36
|
||||
|
||||
- os: ubuntu-18.04
|
||||
name: py36-ubuntu
|
||||
python-version: 3.6
|
||||
- name: py37
|
||||
|
||||
- os: windows-latest
|
||||
name: py36-windows
|
||||
python-version: 3.6
|
||||
|
||||
- os: macOS-latest
|
||||
name: py36-mac
|
||||
python-version: 3.6
|
||||
|
||||
- os: ubuntu-18.04
|
||||
name: py37-ubuntu
|
||||
python-version: 3.7
|
||||
- name: py38
|
||||
|
||||
- os: windows-latest
|
||||
name: py37-windows
|
||||
python-version: 3.7
|
||||
|
||||
- os: macOS-latest
|
||||
name: py37-mac
|
||||
python-version: 3.7
|
||||
|
||||
- os: ubuntu-18.04
|
||||
name: py38-ubuntu
|
||||
python-version: 3.8
|
||||
- name: py39
|
||||
|
||||
- os: windows-latest
|
||||
name: py38-windows
|
||||
python-version: 3.8
|
||||
|
||||
- os: macOS-latest
|
||||
name: py38-mac
|
||||
python-version: 3.8
|
||||
|
||||
- os: ubuntu-18.04
|
||||
name: py39-ubuntu
|
||||
python-version: 3.9
|
||||
- name: devel
|
||||
python-version: 3.8
|
||||
- name: pypy3
|
||||
|
||||
- os: windows-latest
|
||||
name: py39-windows
|
||||
python-version: 3.9
|
||||
|
||||
- os: macOS-latest
|
||||
name: py39-mac
|
||||
python-version: 3.9
|
||||
|
||||
- os: ubuntu-18.04
|
||||
name: pypy3-ubuntu
|
||||
python-version: pypy3
|
||||
|
||||
# Disabling due to https://github.com/actions/setup-python/issues/151
|
||||
# - os: windows-latest
|
||||
# name: pypy3-windows
|
||||
# python-version: pypy3
|
||||
|
||||
- os: macOS-latest
|
||||
name: pypy3-mac
|
||||
python-version: pypy3
|
||||
|
||||
- os: ubuntu-18.04
|
||||
name: devel-ubuntu
|
||||
python-version: 3.8
|
||||
|
||||
steps:
|
||||
- name: Set Newline Behavior
|
||||
run : |
|
||||
git config --global core.autocrlf false
|
||||
- uses: actions/checkout@master
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
|
@ -43,9 +101,15 @@ jobs:
|
|||
- name: Install tox
|
||||
run: |
|
||||
python -m pip install --upgrade tox
|
||||
- name: Get Tox Environment Name From Matrix Name
|
||||
uses: rishabhgupta/split-by@v1
|
||||
id: split-matrix-name
|
||||
with:
|
||||
string: '${{ matrix.name }}'
|
||||
split-by: '-'
|
||||
- name: Test with tox
|
||||
run: |
|
||||
python -m tox -e ${{ matrix.name }}
|
||||
python -m tox -e ${{ steps.split-matrix-name.outputs._0}}
|
||||
build_javascript:
|
||||
name: grunt
|
||||
runs-on: ubuntu-18.04
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
import builtins
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
|
@ -12,6 +13,20 @@ import pytest
|
|||
|
||||
pytest_plugins = ("pytester",)
|
||||
|
||||
if os.name == "nt":
|
||||
# Force a utf-8 encoding on file io (since by default windows does not). See
|
||||
# https://github.com/pytest-dev/pytest-html/issues/336
|
||||
# If we drop support for Python 3.6 and earlier could use python -X utf8 instead.
|
||||
_real_open = builtins.open
|
||||
|
||||
def _open(file, mode="r", buffering=-1, encoding=None, *args, **kwargs):
|
||||
if mode in ("r", "w") and encoding is None:
|
||||
encoding = "utf-8"
|
||||
|
||||
return _real_open(file, mode, buffering, encoding, *args, **kwargs)
|
||||
|
||||
builtins.open = _open
|
||||
|
||||
|
||||
def remove_deprecation_from_recwarn(recwarn):
|
||||
# TODO: Temporary hack until they fix
|
||||
|
|
Loading…
Reference in New Issue