Skip to content

CI

CI #593

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '**/*.md'
- 'examples*/**'
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
schedule:
- cron: '5 4 * * *'
env:
basepython: 3.9
jobs:
lint:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Code linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install base python
uses: actions/setup-python@v4
with:
python-version: ${{env.basepython}}
- name: prepare the environment
run: |
python -m venv .venv
source .venv/bin/activate
pip install -U setuptools pip poetry==1.3.2 tox-poetry
poetry config virtualenvs.create false
poetry install
- name: lint
run: |
python -m venv .venv
source .venv/bin/activate
tox -e linters
tests:
name: Test on ${{ matrix.platform }} with Python ${{ matrix.python }}
runs-on: ubuntu-latest
services:
stack:
image: redis/redis-stack-server:edge
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 6379:6379
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python}}
- name: Prepare environment
run: |
python -m venv .venv
source .venv/bin/activate
pip install -U setuptools pip poetry==1.3.2 tox-poetry
poetry config virtualenvs.create false
poetry install
- name: Run tests
run: |
python -m venv .venv
source .venv/bin/activate
tox -e cover
- name: Upload coverage
uses: codecov/codecov-action@v3
if: matrix.python == '3.9' && matrix.platform != 'macos-11'
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOVTOKEN }}