Skip to content

Create github actions #12

Create github actions

Create github actions #12

name: Python package
on:
push:
branches: [ master ]
tags:
- '*'
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- python-version: 2.7
os: ubuntu-20.04
# - python-version: 3.6
# os: ubuntu-20.04
# - python-version: 3.7
# os: ubuntu-22.04
# - python-version: 3.8
# os: ubuntu-22.04
# - python-version: 3.9
# os: ubuntu-22.04
# - python-version: "3.10"
# os: ubuntu-22.04
# - python-version: "3.11"
# os: ubuntu-22.04
# - python-version: "3.12"
# os: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} != 2.7
if: ${{ matrix.python-version != '2.7' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python 2.7
if: ${{ matrix.python-version == '2.7' }}
run: |
sudo ln -sf /usr/bin/python2.7 /usr/bin/python
sudo apt install curl
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python get-pip.py
which pip2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt
- name: Test with pytest
run: |
pytest
- name: Build and publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: pypa/[email protected]
with:
user: domain-connect
password: ${{ secrets.PYPI_PASSWORD }}
distributions: "sdist bdist_wheel"
skip_existing: true