From e39bb9c73c395738daed57ae689833320d757b61 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 22 Apr 2023 22:53:18 -0400 Subject: Add test job to CI --- .github/workflows/ci.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/lint.yaml | 26 -------------------------- .gitignore | 1 + pyproject.toml | 1 + 4 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..24d39cd --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,29 @@ +name: CI + +on: [push, pull_request] + +jobs: + lint-and-test: + name: Run the project linters + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Install poetry + run: pipx install poetry + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'poetry' + + - name: Install dependencies + run: poetry install + + - name: Run linters + run: poetry run task lint + + - name: Run tests + run: poetry run task test diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 18b5bff..0000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint - -on: [push, pull_request] - -jobs: - run-linters: - name: Run the project linters - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Install poetry - run: pipx install poetry - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - cache: 'poetry' - - - name: Install dependencies - run: poetry install - - - name: Run linters - run: poetry run task lint diff --git a/.gitignore b/.gitignore index 88d7e13..1b8e35e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ __pycache__ .mypy_cache .pytest_cache dist +.coverage diff --git a/pyproject.toml b/pyproject.toml index 2a5f360..c344c97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ autoflake = "^2.0.2" mypy = "^1.2.0" [tool.taskipy.tasks] +test = "pytest --cov=poetry_plugin_taskipy --cov-report=term-missing {tests_dir}" lint = """ task lint_format \ && task lint_analyze \ -- cgit v1.2.3