From ea8d26e53498c5dbdfbff891dfeee01da33e1860 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Thu, 11 Dec 2025 18:38:19 +0100 Subject: [PATCH] Fixed action to working state --- .github/workflows/build-pipeline.yml | 47 ++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml index 54d5e94..39ff3bc 100644 --- a/.github/workflows/build-pipeline.yml +++ b/.github/workflows/build-pipeline.yml @@ -1,4 +1,5 @@ -name: "{{ cookiecutter.project_slug }} CI build" +# GitHub CI build pipeline +name: CI build on: pull_request: @@ -8,7 +9,7 @@ on: - main jobs: build: - runs-on: "{% raw %} ${{ matrix.os }} {% endraw %}" + runs-on: ubuntu-latest env: PYTHONIOENCODING: "utf8" strategy: @@ -18,17 +19,57 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Backup pyproject.toml + run: cp pyproject.toml pyproject.toml.ci.bak + + - name: Strip tooltip entries from pyproject.toml for CI + run: | + # Remove `tooltip = ...` from [project] and drop [project.tooltip] section if present. + python - <<'PY' + from pathlib import Path + p = Path('pyproject.toml') + text = p.read_text() + out_lines = [] + cur_section = None + skip_section = False + for line in text.splitlines(): + s = line.strip() + if s.startswith('[') and s.endswith(']'): + cur_section = s.strip('[]') + # skip any subsection that starts with project.tooltip (or exact match) + if cur_section == 'project.tooltip' or cur_section.startswith('project.tooltip'): + skip_section = True + continue + else: + skip_section = False + if skip_section: + continue + # drop top-level tooltip = ... when inside [project] + if cur_section == 'project' and s and s.split('=')[0].strip() == 'tooltip': + continue + out_lines.append(line) + p.write_text('\n'.join(out_lines) + '\n') + PY + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "{% raw %} ${{ matrix.python-version }} {% endraw %}" + python-version: 3.12 + - name: Install dependencies run: | python -m pip install --upgrade pip pip install .[dev] + - name: Run Linting run: | ruff check . + - name: Run Tests run: | pytest tests/ + + - name: Restore original pyproject.toml + if: always() + run: mv pyproject.toml.ci.bak pyproject.toml