Skip to content

Unpin docs dependencies to fix build issues. #352

Unpin docs dependencies to fix build issues.

Unpin docs dependencies to fix build issues. #352

Workflow file for this run

name: Python tests
on: [push, pull_request]
jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths: '["**.py", ".github/workflows/tox.yml", "tox.ini", "requirements/*.txt"]'
unit_test:
name: Python unit tests
needs: pre_job
runs-on: ubuntu-20.04
strategy:
max-parallel: 5
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('setup.py', 'requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: tox -e py${{ matrix.python-version }}
unit_test_deprecated:
name: Python unit tests (deprecated python versions)
needs: pre_job
runs-on: ubuntu-20.04
strategy:
max-parallel: 3
matrix:
python-version: [2.7]
container:
image: python:${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('setup.py', 'requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: tox -e py${{ matrix.python-version }}
cryptography:
name: Python unit tests + cryptography
needs: pre_job
runs-on: ubuntu-20.04
strategy:
max-parallel: 5
matrix:
# only crypto 3.3 seems to work
python-version: [ 3.6, 3.7, 3.8, 3.9, '3.10', '3.11' ]
crypto-version: [ 3.3 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
sudo apt-get -y -qq update
sudo apt-get install -y openssl libssl-dev
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-crypto${{ matrix.crypto-version }}-${{ hashFiles('setup.py', 'requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: tox -e py${{ matrix.python-version }}-cryptography${{ matrix.crypto-version }}
cryptography_deprecated:
name: Python unit tests (deprecated python versions) + cryptography
needs: pre_job
runs-on: ubuntu-20.04
strategy:
max-parallel: 3
matrix:
# Packages are no longer available for the distribution that comes with the
# python:3.4 image, so we can't install the necessary dependencies. Eventually,
# this will happen to the others as well.
# EOL: [3.4]
python-version: [2.7]
container:
image: python:${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Install system dependencies
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
apt-get -y -qq update
apt-get install -y openssl libssl-dev
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-crypto3.3-${{ hashFiles('setup.py', 'requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: tox -e py${{ matrix.python-version }}-cryptography3.3
postgres:
name: Python postgres unit tests
needs: pre_job
runs-on: ubuntu-20.04
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9 for Postgres
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.tox/py3.6
key: ${{ runner.os }}-tox-py3.6-${{ hashFiles('setup.py', 'requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: tox -e postgres
windows:
name: Python unit tests on Windows Server
needs: pre_job
runs-on: windows-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: tox -e windows