on:
  - pull_request
  - push

name: build

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      memcached:
        image: memcached
        ports:
          - 11211/tcp
        options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5

    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.8"
          cache: 'pip'
          cache-dependency-path: 'requirements-dev.lock'

      - name: Prepare
        run: |
          pip install -r requirements-dev.lock

      - name: run test
        run: |
          pytest -v .