8-redis-support-part-1 #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pull request checks | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
buf: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bufbuild/buf-action@v1 | |
with: | |
breaking_against: 'https://github.com/zerlok/BrokRPC.git#branch=main' | |
push: false | |
static: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.12" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# see details (matrix, python-version, python-version-file, etc.) | |
# https://github.com/actions/setup-python | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install the project dependencies | |
run: poetry install --all-extras | |
- name: Run mypy | |
run: poetry run mypy | |
- name: Run ruff check | |
run: poetry run ruff check | |
- name: Run ruff format | |
run: poetry run ruff format --check | |
test: | |
runs-on: ubuntu-latest | |
services: | |
rabbitmq: | |
image: rabbitmq:4.0.2-alpine | |
ports: | |
- 5672:5672 | |
redis: | |
image: redis:7.4.1-alpine | |
ports: | |
- 6379:6379 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.12" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# see details (matrix, python-version, python-version-file, etc.) | |
# https://github.com/actions/setup-python | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install the project dependencies | |
run: poetry install --all-extras | |
- name: Run pytest | |
run: poetry run pytest --broker-retry-delay=3 --broker-retry-delay-mode=constant --broker-retries-limit=10 --cov-report=xml | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |