diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 48e6d525..cc456234 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,14 +10,6 @@ on: jobs: build: - services: - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 strategy: max-parallel: 9 fail-fast: true @@ -51,6 +43,12 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true + - name: Setup redis + if: ${{ matrix.os != 'windows-latest' }} + uses: shogo82148/actions-setup-redis@v1 + with: + redis-version: 6 + - name: Load cached venv id: cached-poetry-dependencies uses: actions/cache@v2 @@ -72,10 +70,16 @@ jobs: run: | poetry run black --check --diff aiogram tests - - name: Run tests + - name: Run tests (with Redis) + if: ${{ matrix.os != 'windows-latest' }} run: | poetry run pytest --cov=aiogram --cov-config .coveragerc --cov-report=xml --redis redis://redis:6379/0 + - name: Run tests (without Redis) + if: ${{ matrix.os == 'windows-latest' }} + run: | + poetry run pytest --cov=aiogram --cov-config .coveragerc --cov-report=xml --redis + - uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }}