Skip to content

fix(redis): add redis to github test workflow #8

fix(redis): add redis to github test workflow

fix(redis): add redis to github test workflow #8

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Install the latest version of uv and set the python version to 3.13t
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: 3.11
- name: Lint
run: uv run bash scripts/lint.sh
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
fail-fast: false
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: chanx_test_pass
POSTGRES_DB: chanx_test_db
POSTGRES_USER: chanx_test_user
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: chanx_test_db
POSTGRES_USER: chanx_test_user
POSTGRES_PASSWORD: chanx_test_pass
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
REDIS_HOST: redis://localhost:6379
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- run: mkdir coverage
- name: Test
run: uv run --group test --all-extras coverage run -m pytest sandbox
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage