Skip to content

Merge pull request #144 from nnsnodnb/drop-support-python37-2 #384

Merge pull request #144 from nnsnodnb/drop-support-python37-2

Merge pull request #144 from nnsnodnb/drop-support-python37-2 #384

Workflow file for this run

name: Test
on:
push: {}
jobs:
tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
name: Python ${{ matrix.python-version }} tests
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get full Python version
id: full-python-version
run: echo "name=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> "{GITHUB_OUTPUT}"
- name: Bootstrap poetry
shell: bash
run: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install poetry==1.3.1
- name: Configure poetry
shell: bash
run: python -m poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: timeout 10s python -m poetry run pip --version || rm -rf .venv
- name: Install dependencies
shell: bash
run: |
python -m poetry install
echo "${{ secrets.VOIP_PEM_BASE64 }}" | base64 -d > ./tests/clients/voip/dummy.pem
- name: Run pytest
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
python -m poetry run python -m pytest -v tests
python -m poetry run coverage report
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
flag-name: run-${{ matrix.python-version }}
parallel: true
coveralls:
name: Indicate completion to coveralls.io
needs: tests
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true