Skip to content

Commit 6bcb1b5

Browse files
committed
Introduce CI
Signed-off-by: George Melikov <mail@gmelikov.ru>
1 parent 7f617b8 commit 6bcb1b5

File tree

3 files changed

+144
-1
lines changed

3 files changed

+144
-1
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
name: Build distribution 📦
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
- name: Install pypa/build
22+
run: >-
23+
python3 -m
24+
pip install
25+
build
26+
--user
27+
- name: Build a binary wheel and a source tarball
28+
run: python3 -m build
29+
- name: Store the distribution packages
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: python-package-distributions
33+
path: dist/
34+
35+
publish-to-pypi:
36+
name: >-
37+
Publish Python 🐍 distribution 📦 to PyPI
38+
needs:
39+
- build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: pypi
43+
url: https://pypi.org/p/loopster
44+
permissions:
45+
id-token: write # IMPORTANT: mandatory for trusted publishing
46+
47+
steps:
48+
- name: Download all the dists
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: python-package-distributions
52+
path: dist/
53+
- name: Publish distribution 📦 to PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
56+
github-release:
57+
name: >-
58+
Sign the Python 🐍 distribution 📦 with Sigstore
59+
and upload them to GitHub Release
60+
needs:
61+
- publish-to-pypi
62+
runs-on: ubuntu-latest
63+
64+
permissions:
65+
contents: write # IMPORTANT: mandatory for making GitHub Releases
66+
id-token: write # IMPORTANT: mandatory for sigstore
67+
68+
steps:
69+
- name: Download all the dists
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: python-package-distributions
73+
path: dist/
74+
- name: Sign the dists with Sigstore
75+
uses: sigstore/gh-action-sigstore-python@v3.0.0
76+
with:
77+
inputs: >-
78+
./dist/*.tar.gz
79+
./dist/*.whl
80+
- name: Create GitHub Release
81+
env:
82+
GITHUB_TOKEN: ${{ github.token }}
83+
run: >-
84+
gh release create
85+
"$GITHUB_REF_NAME"
86+
--repo "$GITHUB_REPOSITORY"
87+
--notes ""
88+
- name: Upload artifact signatures to GitHub Release
89+
env:
90+
GITHUB_TOKEN: ${{ github.token }}
91+
# Upload to GitHub Release using the `gh` CLI.
92+
# `dist/` contains the built packages, and the
93+
# sigstore-produced signatures and certificates.
94+
run: >-
95+
gh release upload
96+
"$GITHUB_REF_NAME" dist/**
97+
--repo "$GITHUB_REPOSITORY"

.github/workflows/tests.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
Lint:
9+
runs-on: ubuntu-24.04
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
python-version: ["3.8"]
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install tox
20+
run: pip install tox
21+
- name: pep8
22+
run: |
23+
tox -e pep8
24+
tests:
25+
runs-on: ubuntu-24.04
26+
strategy:
27+
fail-fast: true
28+
matrix:
29+
python-version: ["3.8", "3.10", "3.12", "3.13"]
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
- name: Install required packages
36+
run: |
37+
sudo apt update
38+
sudo apt install libev-dev -y
39+
- name: Install tox
40+
run: pip install tox
41+
- name: Unit tests
42+
run: |
43+
tox -e ${{ matrix.python-version }}
44+
- name: Functional tests
45+
run: |
46+
tox -e ${{ matrix.python-version }}-functional

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description-file =
66
long_description_content_type = text/markdown
77
author = VK Tech
88
author-email = digital.tech@corp.mail.ru
9-
home-page = http://infra.pages.gitlab.corp.mail.ru/iaas/libraries/rooster
9+
home-page = https://github.com/vktechdev/loopster
1010
classifier =
1111
Intended Audience :: Developers
1212
License :: OSI Approved :: Apache Software License

0 commit comments

Comments
 (0)