Skip to content

Commit fe036a6

Browse files
committed
Add simple workflows for GHA
1 parent ee1bace commit fe036a6

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
- uses: pre-commit/[email protected]
27+
- name: Tests
28+
run: pytest --cov=onvif --cov-report=term-missing --cov-report=xml tests
29+
- name: Upload coverage to Codecov
30+
uses: codecov/[email protected]
31+
with:
32+
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

0 commit comments

Comments
 (0)