Skip to content

Commit f636df1

Browse files
committed
🔧 (workflows): add GitHub Actions for coverage, docs, and tests
Add workflows for test coverage and documentation deployment to automate CI/CD processes. This ensures consistent testing and documentation updates on the master branch. ✅ (workflows): refactor publish workflow to include tests Separate tests into their own workflow and ensure they run before publishing. This improves reliability by ensuring code is tested before deployment. ⬆️ (pyproject.toml): update version to 0.1.0 and adjust Python requirement Bump version to 0.1.0 to reflect new features and improvements. Adjust Python version requirement to >=3.11 for broader compatibility.
1 parent 9a90e52 commit f636df1

5 files changed

Lines changed: 84 additions & 5 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
coverage:
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v5
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v7
16+
- name: Install Python 3.13
17+
run: uv python install 3.13
18+
- name: Install dependencies
19+
run: uv sync
20+
- name: Run tests with coverage
21+
run: uv run pytest --cov=src --cov-report=xml
22+
- name: Upload coverage report to Codecov
23+
uses: codecov/codecov-action@v4
24+
with:
25+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
docs:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v5
17+
- name: Configure Git Credentials
18+
run: |
19+
git config --global user.name "github-actions[bot]"
20+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
23+
- name: Install Python 3.13
24+
run: uv python install 3.13
25+
- name: Install dependencies
26+
run: uv sync
27+
- name: Deploy Documentation
28+
run: uv run mkdocs gh-deploy --force

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Publish"
1+
name: Publish
22

33
on:
44
push:
@@ -7,8 +7,11 @@ on:
77
- v*
88

99
jobs:
10-
run:
11-
runs-on: ubuntu-latest
10+
tests:
11+
uses: ./.github/workflows/tests.yml
12+
publish:
13+
runs-on: ubuntu-22.04
14+
needs: tests
1215
environment:
1316
name: pypi
1417
permissions:

.github/workflows/tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Tests
2+
3+
on: [workflow_call, pull_request]
4+
5+
jobs:
6+
tests:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
python-version: ["3.11", "3.12", "3.13"]
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v7
17+
- name: Install Python ${{ matrix.python-version }}
18+
run: uv python install ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: uv sync
21+
- name: Run tests
22+
run: uv run pytest
23+
- name: Run linter

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "socketapi"
3-
version = "0.0.0"
3+
version = "0.1.0"
44
description = "SocketAPI is a lightweight Python framework for real-time WebSocket APIs, using a single multiplexed connection with endpoint-like actions and channel subscriptions."
55
license = "MIT"
66
authors = [
@@ -15,7 +15,7 @@ classifiers = [
1515
"Framework :: Pydantic",
1616
"Framework :: Pydantic :: 2",
1717
]
18-
requires-python = ">=3.13"
18+
requires-python = ">=3.11"
1919
dependencies = [
2020
"httpx>=0.28.1",
2121
"pydantic>=2.12.5",

0 commit comments

Comments
 (0)