Skip to content

Commit 3cc6624

Browse files
authored
ci improvements & cleanup (#8)
* fix test collection warning * bump dependencies * refactor * bump version improve release pipeline add badges
1 parent 5243ff9 commit 3cc6624

File tree

6 files changed

+423
-480
lines changed

6 files changed

+423
-480
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,38 @@ on:
66
- 'v*' # Runs only on version tags like v1.2.3
77

88
jobs:
9-
build-and-publish:
9+
publish:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
13+
- uses: actions/checkout@v4
1514

16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.11'
20-
21-
- name: Install Poetry
22-
run: curl -sSL https://install.python-poetry.org | python3 -
23-
24-
- name: Extract tag version
25-
id: get_tag
26-
run: echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
15+
- name: Set up Python & Poetry
16+
run: |
17+
curl -sSL https://install.python-poetry.org | python3 - --version 2.1.3
18+
echo "$HOME/.local/bin" >> $GITHUB_PATH
2719
28-
- name: Validate pyproject.toml version matches tag
20+
- name: Validate version tag matches pyproject.toml
2921
run: |
30-
PYPROJECT_VERSION=$(poetry version -s)
31-
if [ "$PYPROJECT_VERSION" != "$TAG_VERSION" ]; then
32-
echo "Version mismatch! Tag is v$TAG_VERSION but pyproject.toml has $PYPROJECT_VERSION"
22+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
23+
PROJECT_VERSION=$(poetry version -s)
24+
if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then
25+
echo "Tag v$TAG_VERSION does not match pyproject.toml version $PROJECT_VERSION"
3326
exit 1
3427
fi
35-
echo "Version check passed: $PYPROJECT_VERSION"
36-
37-
- name: Configure Poetry for publishing
38-
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
3928
4029
- name: Install dependencies
4130
run: poetry install --no-dev
4231

4332
- name: Build package
4433
run: poetry build
4534

35+
- name: Verify with Twine
36+
run: |
37+
pip install --no-cache-dir twine
38+
twine check dist/*
39+
4640
- name: Publish to PyPI
47-
run: poetry publish
41+
run: |
42+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
43+
poetry publish

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
[![codecov](https://codecov.io/gh/mdambski/liquidity/branch/master/graph/badge.svg)](https://codecov.io/gh/mdambski/liquidity/tree/master)
2-
1+
![CI](https://github.com/mdambski/liquidity/actions/workflows/post-pr.yml/badge.svg)
2+
[![Coverage](https://codecov.io/gh/mdambski/liquidity/branch/master/graph/badge.svg)](https://codecov.io/gh/mdambski/liquidity)
3+
![PyPI](https://img.shields.io/pypi/v/liquidity)
4+
![License](https://img.shields.io/github/license/mdambski/liquidity)
35

46
# Market Liquidity Proxies
57

Taskfile.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
version: '3'
22

33
tasks:
4+
install-deps:
5+
desc: Install all dependencies (runtime + dev)
6+
cmds:
7+
- poetry install --with dev
8+
49
delint:
5-
desc: Run Ruff in fix and format mode
10+
desc: Autofix & format code
611
cmds:
712
- poetry run ruff check --fix-only
813
- poetry run ruff format .
914
- poetry run mypy . --pretty --strict
1015

1116
lint:
12-
desc: Run Ruff in check mode and MyPy
17+
desc: Verify code styles & types
1318
cmds:
1419
- poetry run ruff check
1520
- poetry run ruff format . --check
1621
- poetry run mypy . --pretty --strict
1722

1823
test:
1924
desc: Run unit tests with coverage
25+
deps: [install-deps]
2026
cmds:
2127
- poetry run pytest tests/ --cov=liquidity --ignore tests/e2e --cov-report=xml
2228

2329
test-e2e:
2430
desc: Run end-to-end tests
31+
deps: [install-deps]
2532
cmds:
2633
- poetry run pytest tests/e2e
27-
28-
install-deps:
29-
desc: Install development dependencies
30-
cmds:
31-
- poetry install --with dev

0 commit comments

Comments
 (0)