Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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 .
pip install pytest pytest-cov mypy types-requests

- 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 }}
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ dependencies = [

[tool.setuptools.packages.find]
where = ["src"]

[[tool.mypy.overrides]]
module = "stomp.*"
ignore_missing_imports = true
Empty file added src/swf_common_lib/__init__.py
Empty file.