Skip to content

Commit

Permalink
Split test & test+lint workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
seandstewart committed Sep 9, 2020
1 parent 0022835 commit 5e152fa
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 36 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test & Lint

on: [push]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(f'Python {sys.version} on {sys.platform}')"

- name: Install Linux dependencies
run: |
./.github/ubuntu-install.sh
- name: Install Poetry
uses: dschep/install-poetry-action@v1.2

- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ~/.virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies (with Lint)
run: poetry install --no-dev -E tests -E lint

- name: Lint with flake8
run: "poetry run flake8 ."

- name: Check Formatting with Black
run: "poetry run black . --check"

- name: Static type-check with MyPy
run: "poetry run mypy typic --ignore-missing-imports"

- name: Test with pytest + coverage
run: "poetry run pytest tests typic --doctest-modules --cov --cov-report xml"
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'

- name: Upload coverage to Codecov
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests,${{ matrix.python-version }}
name: codecov-umbrella
fail_ci_if_error: false
36 changes: 2 additions & 34 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test & Lint
name: Test

on: [push]

Expand All @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.7, 3.8, pypy3]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -48,40 +48,8 @@ jobs:
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies (with Lint)
run: poetry install --no-dev -E tests -E lint
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'

- name: Install Dependencies
run: poetry install --no-dev -E tests
if: matrix.python-version != 3.8 && matrix.os != 'ubuntu-latest'

- name: Lint with flake8
run: "poetry run flake8 ."
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'

- name: Check Formatting with Black
run: "poetry run black . --check"
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'

- name: Static type-check with MyPy
run: "poetry run mypy typic --ignore-missing-imports"
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'

- name: Test with pytest + coverage
run: "poetry run pytest tests typic --doctest-modules --cov --cov-report xml"
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'

- name: Test with pytest
run: "poetry run pytest tests typic --doctest-modules"
if: matrix.python-version != 3.8 && matrix.os != 'ubuntu-latest'

- name: Upload coverage to Codecov
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests,${{ matrix.python-version }}
name: codecov-umbrella
fail_ci_if_error: false
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ exclude = ["tests", "docs", "docsrc", "benchmark"]
python = "^3.7"
inflection = "^0.3.1"
pendulum = "^2.1"
typing-extensions = {version = "^3.7", python = "<=3.7"}
dataclasses = {version = "*", python = "~3.6"}
fastjsonschema = {version = "^2.14", optional = true}
ujson = {version = ">=2.0", optional = true}
# tests
Expand Down

0 comments on commit 5e152fa

Please sign in to comment.