From 4e7a5f9a19a3d19920ad4b8b7610bca06aa8ef0d Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Tue, 15 Jun 2021 00:20:03 +0300 Subject: [PATCH] Try start Redis on macos and linux, exclude windows --- .github/workflows/tests.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) 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 }}