Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pip check to workflows #40

Merged
merged 8 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Global rule:
* @sdv-dev/core-contributors
30 changes: 0 additions & 30 deletions .github/workflows/docs.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Integration Tests

on:
- push
- pull_request

jobs:
unit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-10.15, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os == 'windows-latest'
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch>=1.4,<2' -f https://download.pytorch.org/whl/cpu/torch/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install invoke .[test]
- name: Run integration tests
run: invoke integration
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Style Checks

on:
- push
- pull_request

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install invoke .[dev]
- name: Run lint checks
run: invoke lint
30 changes: 30 additions & 0 deletions .github/workflows/minimum.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Unit Tests Minimum Versions

on:
- push
- pull_request

jobs:
minimum:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-10.15, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os == 'windows-latest'
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch==1.4' -f https://download.pytorch.org/whl/cpu/torch/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install invoke .[test]
- name: Test with minimum versions
run: invoke minimum
25 changes: 25 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test README

on:
- push
- pull_request

jobs:
readme:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-10.15] # skip windows bc rundoc fails
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install invoke rundoc .
- name: Run the README.md
run: invoke readme
113 changes: 0 additions & 113 deletions .github/workflows/tests.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Unit Tests

on:
- push
- pull_request

jobs:
unit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-10.15, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os == 'windows-latest'
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch>=1.4,<2' -f https://download.pytorch.org/whl/cpu/torch/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install invoke .[test]
- name: Run unit tests
run: invoke unit
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.8
name: Upload codecov report
run: invoke coverage
uses: codecov/codecov-action@v2
39 changes: 10 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ clean-pyc: ## remove Python file artifacts
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

.PHONY: clean-docs
clean-docs: ## remove previously built docs
rm -f docs/api/*.rst
rm -rf docs/tutorials
-$(MAKE) -C docs clean 2>/dev/null # this fails if sphinx is not yet installed

.PHONY: clean-coverage
clean-coverage: ## remove coverage artifacts
rm -f .coverage
Expand All @@ -65,7 +59,7 @@ clean-test: ## remove test artifacts
rm -fr .pytest_cache

.PHONY: clean
clean: clean-build clean-pyc clean-test clean-coverage clean-docs ## remove all build, test, coverage, docs and Python artifacts
clean: clean-build clean-pyc clean-test clean-coverage ## remove all build, test, coverage and Python artifacts


# INSTALL TARGETS
Expand Down Expand Up @@ -109,9 +103,13 @@ fix-lint: ## fix lint issues using autoflake, autopep8, and isort

# TEST TARGETS

.PHONY: test-pytest
test-pytest: ## run all the tests using pytest
invoke pytest
.PHONY: test-unit
test-unit: ## run unit tests using pytest
invoke unit

.PHONY: test-integration
test-integration: ## run integration tests using pytest
invoke integration

.PHONY: test-readme
test-readme: ## run the readme snippets
Expand All @@ -126,10 +124,10 @@ check-dependencies: ## test if there are any broken dependencies
pip check

.PHONY: test
test: test-pytest test-readme test-tutorials ## test everything that needs test dependencies
test: test-unit test-integration test-readme test-tutorials ## test everything that needs test dependencies

.PHONY: test-devel
test-devel: lint docs ## test everything that needs development dependencies
test-devel: lint ## test everything that needs development dependencies

.PHONY: test-all
test-all: ## run tests on every Python version with tox
Expand All @@ -143,23 +141,6 @@ coverage: ## check code coverage quickly with the default Python
$(BROWSER) htmlcov/index.html


# DOCS TARGETS

.PHONY: docs
docs: clean-docs ## generate Sphinx HTML documentation, including API docs
cp -r tutorials docs/tutorials
sphinx-apidoc --separate --no-toc -M -o docs/api/ deepecho
$(MAKE) -C docs html

.PHONY: view-docs
view-docs: docs ## view docs in browser
$(BROWSER) docs/_build/html/index.html

.PHONY: serve-docs
serve-docs: view-docs ## compile the docs watching for changes
watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' .


# RELEASE TARGETS

.PHONY: dist
Expand Down
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion docs/authors.rst

This file was deleted.

Loading