Skip to content

Commit

Permalink
Merge pull request #131 from hugovk/gha-updates
Browse files Browse the repository at this point in the history
Test Python 3.10-dev
  • Loading branch information
hugovk authored Jun 15, 2020
2 parents 9aa0d4f + e522a8b commit c8af6a1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 59 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
Expand All @@ -28,15 +25,15 @@ jobs:
restore-keys: |
lint-pre-commit-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox
python -m pip install -U pip
python -m pip install -U tox
- name: Lint
run: tox -e lint
70 changes: 24 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,52 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy3", "3.5", "3.6", "3.7", "3.8", "3.9"]
python-version: ["pypy3", "3.5", "3.6", "3.7", "3.8"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# Include new variables for Codecov
- { codecov-flag: GHA_Ubuntu, os: ubuntu-latest }
- { codecov-flag: GHA_macOS, os: macos-latest }
- { codecov-flag: GHA_Windows, os: windows-latest }
exclude:
- { python-version: 3.9, os: macos-latest }
- { python-version: 3.9, os: windows-latest }
- { python-version: pypy3, os: windows-latest }
# Dev versions
- { python-version: 3.9-dev, os: ubuntu-18.04 }
- { python-version: 3.10-dev, os: ubuntu-18.04 }

steps:
- uses: actions/checkout@v2

- name: Ubuntu cache
uses: actions/cache@v1
if: startsWith(matrix.os, 'ubuntu')
- name: Set up Python ${{ matrix.python }} (deadsnakes)
uses: deadsnakes/action@v1.0.0
if: endsWith(matrix.python-version, '-dev')
with:
path: ~/.cache/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')
}}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
python-version: ${{ matrix.python-version }}

- name: macOS cache
uses: actions/cache@v1
if: startsWith(matrix.os, 'macos')
- name: Set up Python ${{ matrix.python-version }}
if: "!endsWith(matrix.python-version, '-dev')"
uses: actions/setup-python@v2
with:
path: ~/Library/Caches/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')
}}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
python-version: ${{ matrix.python-version }}

- name: Windows cache
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install -U "pip>=20.1"
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v1
if: startsWith(matrix.os, 'windows')
with:
path: ~\AppData\Local\pip\Cache
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')
}}
${{ matrix.os }}-${{ matrix.python-version }}-v2-${{
hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: Install Python 3.9
if: matrix.python-version == '3.9'
run: |
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y --no-install-recommends python3.9-dev python3.9-distutils python3.9-venv
python3.9 -m pip install --upgrade pip setuptools
python3.9 -m venv $HOME/venv-python3.9
echo "::set-env name=VIRTUAL_ENV::$HOME/venv-python3.9"
echo "::add-path::$HOME/venv-python3.9/bin"
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != '3.9'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
${{ matrix.os }}-${{ matrix.python-version }}-v2-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --upgrade tox
- name: Tox tests
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.1.0
rev: v2.5.0
hooks:
- id: pyupgrade
args: ["--py3-plus"]
Expand All @@ -12,13 +12,13 @@ repos:
args: ["--target-version", "py35"]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
rev: 3.8.3
hooks:
- id: flake8
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]

- repo: https://github.com/asottile/seed-isort-config
rev: v2.1.0
rev: v2.2.0
hooks:
- id: seed-isort-config

Expand All @@ -33,7 +33,7 @@ repos:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v3.1.0
hooks:
- id: check-merge-conflict
- id: check-toml
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ python:
- 3.7
- 3.8
- 3.9-dev
- 3.10-dev

matrix:
fast_finish: true

install:
- pip install -U pip
Expand Down

0 comments on commit c8af6a1

Please sign in to comment.