# Hiredis-py integration tests workflow (redis/redis-py)

> The Hiredis-py integration tests workflow from redis/redis-py, explained and optimized by Latchkey.

Source: https://latchkey.dev/workflows/redis-redis-py-hiredis-py-integration  
Upstream: [redis/redis-py](https://github.com/redis/redis-py/blob/master/.github/workflows/hiredis-py-integration.yaml) (.github/workflows/hiredis-py-integration.yaml), licence MIT

## What it does

This is the Hiredis-py integration tests workflow from the redis/redis-py repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

## The workflow

```yaml
name: Hiredis-py integration tests

on:
  workflow_dispatch:
    inputs:
      redis-py-branch:
        description: 'redis-py branch to run tests on'
        required: true
        default: 'master'
      hiredis-branch:
        description: 'hiredis-py branch to run tests on'
        required: true
        default: 'master'

concurrency:
  group: ${{ github.event.pull_request.number || github.ref }}-hiredis-integration
  cancel-in-progress: true

permissions:
  contents: read  #  to fetch code (actions/checkout)

env:
  CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  # this speeds up coverage with Python 3.12: https://github.com/nedbat/coveragepy/issues/1665
  COVERAGE_CORE: sysmon
  CURRENT_REDIS_VERSION: '8.8.0'

jobs:
  redis_version:
    runs-on: ubuntu-latest
    outputs:
      CURRENT: ${{ env.CURRENT_REDIS_VERSION }}
    steps:
      - name: Compute outputs
        run: |
          echo "CURRENT=${{ env.CURRENT_REDIS_VERSION }}" >> $GITHUB_OUTPUT

  hiredis-tests:
    runs-on: ubuntu-latest
    needs: [redis_version]
    timeout-minutes: 60
    strategy:
      max-parallel: 15
      fail-fast: false
      matrix:
        redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
        python-version: [ '3.10', '3.14', '3.14t']
        parser-backend: [ 'hiredis' ]
        hiredis-version: [ 'unstable' ]
        event-loop: [ 'asyncio' ]
        test-config:
          - fixed-clients
          - default-legacy_responses-standalone
          - default-legacy_responses-cluster
          - default-unified_responses-standalone
          - default-unified_responses-cluster
          - 2-legacy_responses-standalone
          - 2-legacy_responses-cluster
          - 2-unified_responses-standalone
          - 2-unified_responses-cluster
          - 3-legacy_responses-standalone
          - 3-legacy_responses-cluster
          - 3-unified_responses-standalone
          - 3-unified_responses-cluster
    env:
      ACTIONS_ALLOW_UNSECURE_COMMANDS: true
    name: Redis ${{ matrix.redis-version }}; Python ${{ matrix.python-version }}; RESP Parser:${{matrix.parser-backend}} (${{ matrix.hiredis-version }}); EL:${{matrix.event-loop}}; Config:${{matrix.test-config}}
    steps:
      - uses: actions/checkout@v7
        with:
          ref: ${{ inputs.redis-py-branch }}
      - name: Run tests
        uses: ./.github/actions/run-tests
        with:
          python-version: ${{ matrix.python-version }}
          parser-backend: ${{ matrix.parser-backend }}
          redis-version: ${{ matrix.redis-version }}
          hiredis-version: ${{ matrix.hiredis-version }}
          hiredis-branch: ${{ inputs.hiredis-branch }}
          test-config: ${{ matrix.test-config }}
```

## FAQ

### What does the Hiredis-py integration tests workflow (redis/redis-py) workflow do?

This is the Hiredis-py integration tests workflow from the redis/redis-py repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

### What CI health grade does this workflow get?

This Automation and other workflow grades A. Paste your own workflow into the Latchkey grader to see its grade and the exact fixes.

### How can I improve this Automation and other workflow?

Add job timeouts. Latchkey applies these automatically on managed runners when you point runs-on at Latchkey.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
