From 6a6f807a967fc9533cda3b25b42a4baa279e9adb Mon Sep 17 00:00:00 2001 From: davfsa Date: Mon, 30 Aug 2021 22:51:45 +0200 Subject: [PATCH] Switch pipeline to Github Actions (#866) --- .github/workflows/ci.yml | 67 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 53 ------------------------------- test-requirements.txt | 2 +- 3 files changed, 68 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..0e368d104 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,67 @@ +name: Test and lint + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + tests: + name: Run tests + + strategy: + fail-fast: false + matrix: + # Python 3.4 disabled, due to problems with GitHub Actions. + python-version: [3.10-dev, 3.9, 3.8, 3.7, 3.6, 3.5, 2.7] + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r test-requirements.txt + + - name: Run tests + env: + PYTHON_VERSION: ${{ matrix.python-version }} + run: | + export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"` + if [[ $PYTHON_VERSION < '3.7' ]]; then pytest $PYTHONPATH; fi + + if [[ $PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi + export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"` + pytest $PYTHONPATH + + linting: + name: Run linting + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r test-requirements.txt + + - name: Run linting + run: | + flake8 + flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3e6391950..000000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: python - -jobs: - include: - - name: "3.9" - dist: xenial - python: 3.9.0 - - name: "3.8" - dist: xenial - python: 3.8.0 - - name: "3.7.3" - dist: xenial - python: 3.7.3 - - name: "3.7.2" - dist: xenial - python: 3.7.2 - - name: "3.7.1" - dist: xenial - python: 3.7.1 - - name: "3.7.0" - dist: xenial - python: 3.7.0 - - name: "3.6.2" - python: 3.6.2 - - name: "3.6.1" - python: 3.6.1 - - name: "3.6" - python: 3.6 - - name: "3.5.3" - python: 3.5.3 - - name: "3.5.2" - python: 3.5.2 -## - name: "3.5.1" -## dist: trusty -## python: 3.5.1 - - name: "3.5" - python: 3.5 - - name: "3.4" - python: 3.4 - - name: "2.7" - python: 2.7 - -install: -- pip install -r test-requirements.txt - -script: - - export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"`; - if [[ $TRAVIS_PYTHON_VERSION < '3.7' ]]; then py.test $PYTHONPATH; fi - - if [[ $TRAVIS_PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi - - export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"`; - py.test $PYTHONPATH; - - if [[ $TRAVIS_PYTHON_VERSION == '3.8' ]]; then flake8; fi - - if [[ $TRAVIS_PYTHON_VERSION == '3.8' ]]; then flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py; fi diff --git a/test-requirements.txt b/test-requirements.txt index 1a033f49d..1e44ed02b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ flake8; python_version >= '3.6' flake8-bugbear; python_version >= '3.6' flake8-pyi; python_version >= '3.6' -pytest>=4.4.1; python_version >= '3.4' +pytest==4.6.11 pytest-xdist>=1.18; python_version >= '3.4' pytest-cov>=2.4.0; python_version >= '3.4'