Skip to content

Commit b5f2ca3

Browse files
committed
feat: add GitHub Actions workflows for publishing to PyPI and running tests
1 parent 3095f94 commit b5f2ca3

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
name: Build and publish to PyPI
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.9'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build twine
24+
25+
- name: Build package
26+
run: python -m build
27+
28+
- name: Check build
29+
run: twine check dist/*
30+
31+
- name: Publish to PyPI
32+
env:
33+
TWINE_USERNAME: __token__
34+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35+
run: twine upload dist/*

.github/workflows/test.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
name: Test Python ${{ matrix.python-version }}
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
python-version: ['3.9', '3.10', '3.11', '3.12']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
27+
- name: Install Node.js dependencies
28+
run: npm install
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install Python dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -e ".[dev]"
39+
40+
- name: Run tests
41+
run: pytest tests/ -v --cov=vortex_sdk --cov-report=xml
42+
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@v3
45+
with:
46+
file: ./coverage.xml
47+
flags: unittests
48+
name: codecov-umbrella
49+
fail_ci_if_error: false
50+
51+
lint:
52+
name: Lint and Type Check
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Set up Python
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: '3.9'
62+
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
pip install -e ".[dev]"
67+
68+
- name: Run black
69+
run: black --check src/ tests/ examples/
70+
71+
- name: Run ruff
72+
run: ruff check src/ tests/ examples/
73+
74+
- name: Run mypy
75+
run: mypy src/

0 commit comments

Comments
 (0)