summaryrefslogtreecommitdiff
path: root/.github/workflows/doctests.yml
blob: 0c56e5e212ee6e4777c1207803fc84a1b4828a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Documentation Tests

on:
  push:
  pull_request:

  workflow_dispatch:

permissions:
  contents: read

jobs:
  doctests:
    runs-on: ubuntu-latest
    services:
      redis-stack:
        image: redis/redis-stack-server:latest
        options: >-
          --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
        ports:
          - 6379:6379
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: 3.9
          cache: 'pip'
      - run: |
          sudo apt update
          sudo apt install -y redis-tools
      - name: lint check
        run: |
          pip install -r dev_requirements.txt
          pip install -r requirements.txt
          isort --check-only --diff doctests/*.py
          black --target-version py39 --check --diff doctests/*.py

      - name: run tests
        run: |
          python setup.py build
          python setup.py install
          sh doctests/run_examples.sh