Skip to content

Commit 0750ad4

Browse files
committed
ci: add code coverage badge (and others)
1 parent 4c3473f commit 0750ad4

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/workflows/coverage-gist.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Update Coverage Badge
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
env:
8+
POETRY_VERSION: "1.8.3"
9+
10+
jobs:
11+
coverage:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python 3.11
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.11'
22+
cache: 'pip'
23+
24+
- name: Install Poetry
25+
uses: snok/install-poetry@v1
26+
with:
27+
version: ${{ env.POETRY_VERSION }}
28+
29+
- name: Install dependencies
30+
run: |
31+
pip wheel --no-cache-dir --use-pep517 ml-dtypes
32+
poetry install --all-extras
33+
34+
- name: Set Redis image name
35+
run: |
36+
echo "REDIS_IMAGE=redis/redis-stack-server:latest" >> $GITHUB_ENV
37+
38+
- name: Run tests with coverage
39+
run: |
40+
poetry run pytest --cov=langgraph --cov-report=term --cov-report=json
41+
COVERAGE=$(python -c "import json; print(int(json.load(open('coverage.json'))['totals']['percent_covered']))")
42+
echo "COVERAGE=${COVERAGE}" >> $GITHUB_ENV
43+
44+
# Set color based on coverage
45+
if [ $COVERAGE -lt 70 ]; then
46+
echo "COLOR=red" >> $GITHUB_ENV
47+
elif [ $COVERAGE -lt 80 ]; then
48+
echo "COLOR=yellow" >> $GITHUB_ENV
49+
else
50+
echo "COLOR=green" >> $GITHUB_ENV
51+
fi
52+
53+
- name: Create Coverage Badge
54+
uses: schneegans/[email protected]
55+
with:
56+
auth: ${{ secrets.GIST_TOKEN }}
57+
gistID: ${{ secrets.GIST_ID }}
58+
filename: langgraph-redis-coverage.json
59+
label: Coverage
60+
message: ${{ env.COVERAGE }}%
61+
color: ${{ env.COLOR }}

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# LangGraph Redis
22

3+
[![PyPI version](https://badge.fury.io/py/langgraph-checkpoint-redis.svg)](https://badge.fury.io/py/langgraph-checkpoint-redis)
4+
[![Python versions](https://img.shields.io/pypi/pyversions/langgraph-checkpoint-redis.svg)](https://pypi.org/project/langgraph-checkpoint-redis/)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6+
[![Tests](https://github.com/redis-developer/langgraph-redis/actions/workflows/test.yml/badge.svg)](https://github.com/redis-developer/langgraph-redis/actions/workflows/test.yml)
7+
[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/bsbodden/4b5aae70fef2c9606648bce5d010e129/raw/langgraph-redis-coverage.json)](https://github.com/redis-developer/langgraph-redis/actions/workflows/coverage-gist.yml)
8+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
9+
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
10+
[![Checked with mypy](https://img.shields.io/badge/mypy-checked-blue)](http://mypy-lang.org/)
11+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
12+
[![Downloads](https://static.pepy.tech/badge/langgraph-checkpoint-redis)](https://pepy.tech/project/langgraph-checkpoint-redis)
13+
[![Redis](https://img.shields.io/badge/Redis-8.0%2B-DC382D?logo=redis&logoColor=white)](https://redis.io)
14+
315
This repository contains Redis implementations for LangGraph, providing both Checkpoint Savers and Stores functionality.
416

517
## Overview
@@ -80,11 +92,13 @@ saver.setup()
8092
#### Azure Cache for Redis Specific Settings
8193

8294
For Azure Cache for Redis Enterprise tier:
95+
8396
- **Port**: Use port `10000` for Enterprise tier with TLS, or `6379` for standard
8497
- **Modules**: Enterprise tier includes RediSearch and RedisJSON by default
8598
- **SSL/TLS**: Always enabled, minimum TLS 1.2 for Enterprise
8699

87100
Example for Azure Cache for Redis Enterprise:
101+
88102
```python
89103
client = Redis(
90104
host="your-cache.redisenterprise.cache.azure.net",

0 commit comments

Comments
 (0)