Skip to content

Commit b785edb

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

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/coverage-gist.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Update Coverage Badge
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
coverage:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.11'
18+
19+
- name: Install Poetry
20+
uses: snok/install-poetry@v1
21+
with:
22+
version: 1.8.3
23+
24+
- name: Install dependencies
25+
run: |
26+
poetry install --all-extras
27+
28+
- name: Start Redis Stack
29+
run: |
30+
docker run -d --name redis-stack -p 6379:6379 redis/redis-stack-server:latest
31+
32+
- name: Run tests with coverage
33+
run: |
34+
poetry run pytest --cov=langgraph --cov-report=term --cov-report=json
35+
COVERAGE=$(python -c "import json; print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
36+
echo "COVERAGE=${COVERAGE}" >> $GITHUB_ENV
37+
38+
- name: Create Coverage Badge
39+
uses: schneegans/[email protected]
40+
with:
41+
auth: ${{ secrets.GIST_TOKEN }}
42+
gistID: ${{ secrets.GIST_ID }}
43+
filename: langgraph-redis-coverage.json
44+
label: Coverage
45+
message: ${{ env.COVERAGE }}%
46+
color: ${{
47+
env.COVERAGE < 70 && 'red' ||
48+
env.COVERAGE < 80 && 'yellow' ||
49+
'green'
50+
}}
51+
52+
- name: Stop Redis
53+
if: always()
54+
run: docker stop redis-stack && docker rm redis-stack

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.github.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)