From 5a754b7b06f67d5531bd4178b2298af460878c29 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 4 Nov 2025 16:13:33 -0500 Subject: [PATCH 1/5] ci: add pull request build workflow for the project --- .github/workflows/build-pull-request.yaml | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/build-pull-request.yaml diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml new file mode 100644 index 0000000..01eb9ef --- /dev/null +++ b/.github/workflows/build-pull-request.yaml @@ -0,0 +1,34 @@ +name: Build Pull Request + +on: + pull_request: + branches: + - '**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build-n-test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: [3.12, 3.13, 3.14] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + + - name: Upgrade pip and install dependencies + run: | + python -m pip install --upgrade pip + pip install . From 7e733eb2b1d4efb0aba2411f4358a3510160a1df Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 4 Nov 2025 16:33:25 -0500 Subject: [PATCH 2/5] ci: add mypy type checking step to pull request workflow Installs mypy and runs static type checks on the src directory during PR builds. Ensures type consistency is validated in CI. --- .github/workflows/build-pull-request.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml index 01eb9ef..792f087 100644 --- a/.github/workflows/build-pull-request.yaml +++ b/.github/workflows/build-pull-request.yaml @@ -32,3 +32,8 @@ jobs: run: | python -m pip install --upgrade pip pip install . + pip install mypy + + - name: Type check with mypy + run: | + mypy src From e2c38bc0dc27aba1dc086d26a24f19c3f8e6e037 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 4 Nov 2025 16:43:59 -0500 Subject: [PATCH 3/5] ci: install types-requests and ignore missing stomp types in mypy config Adds types-requests to the PR build workflow to resolve missing stubs. Updates pyproject.toml to silence mypy errors for stomp imports. --- .github/workflows/build-pull-request.yaml | 2 +- pyproject.toml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml index 792f087..55e16c4 100644 --- a/.github/workflows/build-pull-request.yaml +++ b/.github/workflows/build-pull-request.yaml @@ -32,7 +32,7 @@ jobs: run: | python -m pip install --upgrade pip pip install . - pip install mypy + pip install mypy types-requests - name: Type check with mypy run: | diff --git a/pyproject.toml b/pyproject.toml index 2a431db..986ee1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,3 +19,7 @@ dependencies = [ [tool.setuptools.packages.find] where = ["src"] + +[[tool.mypy.overrides]] +module = "stomp.*" +ignore_missing_imports = true From 32f7093b1c74cb13fe20634dc9b5256f6866cebc Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 4 Nov 2025 16:51:58 -0500 Subject: [PATCH 4/5] fix: add missing __init__.py to mark swf_common_lib as a package --- src/swf_common_lib/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/swf_common_lib/__init__.py diff --git a/src/swf_common_lib/__init__.py b/src/swf_common_lib/__init__.py new file mode 100644 index 0000000..e69de29 From ac5264359fb427c21b06efc4d65eb0596076c03a Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 4 Nov 2025 17:03:12 -0500 Subject: [PATCH 5/5] ci: add pytest coverage and post as PR comment Extends the pull request build to run pytest with coverage reporting. --- .github/workflows/build-pull-request.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml index 55e16c4..451b223 100644 --- a/.github/workflows/build-pull-request.yaml +++ b/.github/workflows/build-pull-request.yaml @@ -32,8 +32,22 @@ jobs: run: | python -m pip install --upgrade pip pip install . - pip install mypy types-requests + pip install pytest pytest-cov mypy types-requests - - name: Type check with mypy + - name: Check types run: | mypy src + + - name: Run tests + run: | + pytest -v --cov=src --cov-report=term-missing | tee coverage.txt + tail -n 10 coverage.txt > coverage_summary.txt + + - name: Post test coverage as PR comment + if: matrix.python-version == '3.14' + run: | + body=$(printf "### Test Coverage Summary\n\`\`\`\n%s\n\`\`\`" "$(cat coverage_summary.txt)") + gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -f body="$body" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}