Skip to content

Commit 785c182

Browse files
authored
Add simple workflows for GHA (#56)
1 parent 44f67e5 commit 785c182

File tree

5 files changed

+99
-17
lines changed

5 files changed

+99
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
coverage:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
cache: "pip"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -r requirements_dev.txt .
26+
- name: Pre-commit
27+
uses: pre-commit/[email protected]
28+
- name: Tests
29+
run: pytest --cov=onvif --cov-report=term-missing --cov-report=xml tests
30+
- name: Upload coverage to Codecov
31+
uses: codecov/[email protected]
32+
with:
33+
token: ${{ secrets.CODECOV_TOKEN }} # required

.github/workflows/python-publish.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
name: Upload Python Package
4+
5+
on:
6+
release:
7+
types: [created]
8+
9+
jobs:
10+
build:
11+
name: Build distribution 📦
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.x"
20+
- name: Install pypa/build
21+
run: >-
22+
python3 -m
23+
pip install
24+
build
25+
--user
26+
- name: Build a binary wheel and a source tarball
27+
run: python3 -m build
28+
- name: Store the distribution packages
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
34+
deploy:
35+
permissions:
36+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
37+
runs-on: ubuntu-latest
38+
needs:
39+
- build
40+
name: >-
41+
Publish Python 🐍 distribution 📦 to PyPI
42+
environment:
43+
name: pypi
44+
url: https://pypi.org/p/onvif-zeep-async
45+
46+
steps:
47+
- name: Download all the dists
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: python-package-distributions
51+
path: dist/
52+
- name: Publish package distributions to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
exclude: "CHANGELOG.md|.copier-answers.yml|.all-contributorsrc"
4-
default_stages: [pre-commit]
4+
default_stages: [commit]
55

66
ci:
77
autofix_commit_msg: "chore(pre-commit.ci): auto fixes"

requirements.txt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
# Package
2-
httpx==0.19.0
2+
httpx==0.28.0
33
zeep[async]==4.3.1
4-
5-
# Dev
6-
pytest
7-
pytest-cov
8-
pylint
9-
10-
# pre-commit
11-
pre-commit==2.7.1
12-
pyupgrade==3.19.0
13-
black==20.8b1
14-
flake8==7.1.1
15-
# flake8-docstrings==1.5.0
16-
pydocstyle==6.3.0
17-
bandit==1.6.2
18-
isort==5.13.2

requirements_dev.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Package
2+
-r requirements.txt
3+
4+
# Dev
5+
pytest
6+
pytest-cov
7+
pytest-asyncio
8+
pylint
9+
10+
# pre-commit
11+
pre-commit==2.7.1

0 commit comments

Comments
 (0)