From 8522e5771879375244a10f4f6c379f9bd1e2008b Mon Sep 17 00:00:00 2001 From: hnakashima Date: Sun, 26 Nov 2023 12:07:07 +0900 Subject: [PATCH] Update task names in CI workflow and add format check task Updated task names in CI workflow file for a clearer understanding of the tests being run during the workflow and added format check task in pyproject.toml file. These tests now exactly follow the workflow: Check format, Check lint, Check mypy, then run unittests with coverage report. This change makes the intent of each stage of the Continuous Integration process more explicit and ensures that a format check is included in the workflow execution. --- .github/workflows/ci.yaml | 11 +++++++---- pyproject.toml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 19a06c7..13ccb2d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,12 +22,15 @@ jobs: poetry-version: "1.6.1" - name: Install dependencies run: poetry install - - name: Mypy - run: poetry run task mypy - - name: Ruff + - name: Check format + run: | + poetry run task check_format + - name: Check lint run: | poetry run task lint - - name: pytest coverage + - name: Check mypy + run: poetry run task mypy + - name: Run unittests with coverage check run: | poetry run pytest --cov --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt - name: Create Coverage Comment diff --git a/pyproject.toml b/pyproject.toml index 728e285..9993ba7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ build-backend = "poetry.core.masonry.api" [tool.taskipy.tasks] format = "python -m ruff format ." +check_format = "python -m ruff format . --check" test = "python -m pytest -v --cov --cov-branch --no-cov-on-fail --cov-report=html" # lint lint_src = "python -m ruff check reinforcement_learning"