Skip to content

Restore compatiblility with Python 2 #121

Restore compatiblility with Python 2

Restore compatiblility with Python 2 #121

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on pull request events
pull_request:
branches: [ py2 ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
env:
TRAVIS: 'true' # Skip tests requiring data
PGHOST: localhost
PGDATABASE: somutils_test_db
PGUSER: testdummy
PGPASSWORD: testdummy_password
BRANCH: ${{ github.ref }}
strategy:
matrix:
python-version:
- '2.7'
name: Python ${{ matrix.python-version }}
services:
postgres: # Required to run dbutils tests
image: postgres:latest
env:
POSTGRES_DB: somutils_test_db
POSTGRES_USER: testdummy
POSTGRES_PASSWORD: testdummy_password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set up Python 2.7
run: |
sudo apt-get update
sudo apt-get install -y python2.7 python2.7-dev
sudo ln -sf python2.7 /usr/bin/python
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
rm get-pip.py
pip install --upgrade pip setuptools wheel
- uses: BSFishy/pip-action@v1
with:
packages: |
coveralls
pytest-cov
- name: Install dependencies
run: |
pip install -e .
- name: Unit tests
run: |
pytest --cov=somutils somutils
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Unit tests
coveralls_finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true