Skip to content

Commit

Permalink
Switch CI to GH actions, add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Nov 18, 2021
1 parent b887ef4 commit 5b3ae07
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 43 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- { python: '3.8', cc: gcc, libversion: master }
# python versions
- { python: '3.6', cc: gcc, libversion: master }
- { python: '3.7', cc: gcc, libversion: master }
- { python: '3.9', cc: gcc, libversion: master }
- { python: '3.10', cc: gcc, libversion: master }
- { python: '3.11.0-alpha.2', cc: gcc, libversion: master }
# compilers
- { python: '3.8', cc: clang, libversion: master }
# libversion versions
- { python: '3.8', cc: gcc, libversion: 2.9.1 }
- { python: '3.8', cc: gcc, libversion: 2.8.1 }
- { python: '3.8', cc: gcc, libversion: 2.7.0 }
- { python: '3.8', cc: gcc, libversion: 2.6.0 }
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install libversion
run: |
sudo apt-get install cmake
wget -qO- https://github.com/repology/libversion/archive/${{ matrix.libversion }}.tar.gz | tar -xzf-
cd libversion-${{ matrix.libversion }}
cmake .
cmake --build .
sudo cmake --install .
sudo ldconfig
- name: Install dev depends
run: pip install -r requirements-dev.txt
- name: Install benchmark competitiors
run: |
pip install cmp_version
pip install version || true # for the case it learns python3
- name: Set up environment
run: |
echo 'CC=${{ matrix.cc }}' >> $GITHUB_ENV
echo 'CFLAGS=-UNDEBUG -Wall -Wextra -Werror -Wno-error=deprecated-declarations' >> $GITHUB_ENV # warning for python 3.8 only
- name: Build
run: python setup.py build
- name: Install
run: python setup.py develop
- name: Run flake8
run: make flake8
- name: Run tests
run: make test
- name: Run mypy
run: make test
- name: Run isort-check
run: make isort-check
- name: Run compare
run: cd demos && python compare.py
- name: Run benchmark
run: cd demos && python benchmark.py
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PYTEST?= pytest
FLAKE8?= flake8
MYPY?= mypy
ISORT?= isort
PYTHON?= python3
TWINE?= twine

lint: test flake8 mypy isort-check

test::
${PYTEST} ${PYTEST_ARGS} -v -rs

flake8::
${FLAKE8} ${FLAKE8_ARGS} --application-import-names=libversion libversion tests

mypy::
${MYPY} ${MYPY_ARGS} libversion

isort-check::
${ISORT} ${ISORT_ARGS} --check libversion/*.py tests/*.py

isort::
${ISORT} ${ISORT_ARGS} libversion/*.py tests/*.py

sdist::
${PYTHON} setup.py sdist

release::
rm -rf dist
${PYTHON} setup.py sdist
${TWINE} upload dist/*.tar.gz
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://repology.org/badge/vertical-allrepos/python:libversion.svg" alt="py-libversion packaging status" align="right">
</a>

[![Build Status](https://travis-ci.org/repology/py-libversion.svg?branch=master)](https://travis-ci.org/repology/py-libversion)
[![CI](https://github.com/repology/py-libversion/actions/workflows/ci.yml/badge.svg)](https://github.com/repology/py-libversion/actions/workflows/ci.yml)
[![PyPI downloads](https://img.shields.io/pypi/dm/libversion.svg)](https://pypi.org/project/libversion/)
[![PyPI version](https://img.shields.io/pypi/v/libversion.svg)](https://pypi.org/project/libversion/)
[![PyPI pythons](https://img.shields.io/pypi/pyversions/libversion.svg)](https://pypi.org/project/libversion/)
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ flake8
flake8-builtins
flake8-import-order
flake8-quotes
isort
mypy
pep8-naming
pytest
tabulate

0 comments on commit 5b3ae07

Please sign in to comment.