Skip to content

Connection properties assume tls connection #27 #89

Connection properties assume tls connection #27

Connection properties assume tls connection #27 #89

# This workflow will install Python & Poetry dependencies, run tests with a single version of Python 3.11
# Upload code coverage results to codecov.io
name: NuroPb Testing and Code Coverage
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3.12-management
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672
- 15672
etcd:
image: quay.io/coreos/etcd:v3.4.15
ports:
- 2379
- 2380
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: '3.11'
#----------------------------------------------
# setup rabbitmq
#----------------------------------------------
# - name: RabbitMQ Action with mng
# uses: mer-team/rabbitmq-mng-action@v1.2
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --all-extras --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --all-extras --no-interaction
#----------------------------------------------
# run test suite and output coverage file
#----------------------------------------------
- name: Test with coverage and pytest
run: poetry run coverage run -m pytest && poetry run coverage xml
env:
RMQ_AMQP_PORT: ${{ job.services.rabbitmq.ports['5672'] }}
RMQ_API_PORT: ${{ job.services.rabbitmq.ports['15672'] }}
#----------------------------------------------
# Upload coverage file to codeconv.io
#----------------------------------------------
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}