diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0184a2266..795b6278a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,18 +38,21 @@ jobs: pip install --upgrade -r <(grep -Ev '^allennlp$' requirements.txt) pip install --upgrade -r dev-requirements.txt + - name: Show pip freeze + run: | + pip freeze + - name: Lint run: | - flake8 -v - black -v --check . + make lint - name: Type check run: | - mypy allennlp_models --ignore-missing-imports --no-strict-optional --no-site-packages + make typecheck - name: Run tests run: | - pytest --cov=allennlp_models/ --cov-report=xml + make test-with-cov - name: Upload coverage to Codecov if: matrix.python == '3.7' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27cc69141..faed318da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,16 +26,15 @@ jobs: - name: Lint run: | - flake8 -v - black -v --check . + make lint - name: Type check run: | - mypy allennlp_models --ignore-missing-imports --no-strict-optional --no-site-packages + make typecheck - name: Run tests run: | - pytest -v + make test - name: Build Package run: | diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..807d68f7e --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +.PHONY : lint +lint : + flake8 -v + black -v --check . + +.PHONY : typecheck +typecheck : + mypy allennlp_models --ignore-missing-imports --no-strict-optional --no-site-packages + +.PHONY : test +test : + pytest -v --color=yes + +.PHONY : test-with-cov +test-with-cov : + pytest -v --color=yes --cov=allennlp_models/ --cov-report=xml