diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1607207..7d36282 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,8 +30,7 @@ jobs: - name: Test shell: bash - # FIXME: This is ugly; move this inside `j test`. - run: poetry run j test -- -- --junitxml=tests/coverage/pytest.xml --cov-report= --cov-report=html:tests/coverage/html --cov=yaml_ld | tee tests/coverage/pytest-coverage.txt + run: poetry run j ci # Report only changed files because the result is too large - name: Pytest Coverage Comment diff --git a/jeeves.py b/jeeves.py index 5dce366..00571f0 100644 --- a/jeeves.py +++ b/jeeves.py @@ -1,6 +1,21 @@ -from sh import git +from sh import git, pytest, tee def update_submodule(): """Update the `specification` submodule from GitHub.""" git.submodule.update('--remote', '--init', '--recursive') + + +def ci(): + """Run CI.""" + tee( + 'tests/coverage/pytest-coverage.txt', + _in=pytest( + 'tests', + junitxml='tests/coverage/pytest.xml', + cov_report=['', 'html:tests/coverage/html'], + cov='yaml_ld', + _piped=True, + _ok_code={0, 1}, + ), + )