From 480c6c51d628c75156e6515918f8c69a734d527b Mon Sep 17 00:00:00 2001 From: adamghill Date: Sun, 28 Jul 2024 17:41:23 -0400 Subject: [PATCH] Update CI workflow. --- .github/workflows/ci.yml | 24 +++++++++++++++++++++--- pyproject.toml | 4 ++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 384ca820..50e0fd24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: branches: - "main" +env: + PYTHON_VERSION: 3.11 + jobs: test: name: Run tests & display coverage @@ -20,11 +23,26 @@ jobs: contents: write steps: - uses: actions/checkout@v4 + with: + fetch-depth: 1 - - name: Install everything, run the tests, produce the .coverage file + - name: Install Poetry run: | - run coverage run -m pytest - run coverage xml + pipx install poetry + poetry config virtualenvs.path ~/.virtualenvs${{ env.PYTHON_VERSION }} + + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v3 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: "poetry" + + - name: Install dependencies + run: | + poetry install -E minify + + - name: Produce the .coverage file + run: poetry run coverage run -m pytest - name: Coverage comment id: coverage_comment diff --git a/pyproject.toml b/pyproject.toml index ec00f511..ac9d1cb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -174,6 +174,10 @@ disable_error_code = ["empty-body"] module = "decorator" ignore_missing_imports = true +[tool.coverage.run] +branch = true +relative_files = true + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api"