Skip to content

Commit

Permalink
Merge pull request #16 from pckroon/ci_maintenance
Browse files Browse the repository at this point in the history
Set up github actions for CI
  • Loading branch information
pckroon committed Oct 21, 2021
2 parents 4e1ea0f + 077c45b commit 21ef189
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 74 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This workflow will upload a Python Package using the PyPi action workflow

name: Upload Python Package

on:
release:
types: [published]

env:
SKIP_GENERATE_AUTHORS: 1
SKIP_WRITE_GIT_CHANGELOG: 1

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
py_version: ["3.9"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py_version }}
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
- name: Install package and requirements
run: |
pip install --upgrade .
pip install -r requirements-tests.txt
- name: Run pytest with codecoverage
run: |
coverage run --source=hypothesis_networkx $(which pytest) --hypothesis-show-statistics
coverage report
codecov
deploy:
needs: [build]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
pip install pbr
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy

60 changes: 60 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: test package

on:
push:
branches: [ master ]
pull_request:

env:
SKIP_GENERATE_AUTHORS: 1
SKIP_WRITE_GIT_CHANGELOG: 1

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py_version }}
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
- name: Install package and requirements
run: |
pip install --upgrade .
pip install -r requirements-tests.txt
- name: Run pytest with codecoverage
run: |
coverage run --source=hypothesis_networkx $(which pytest) --hypothesis-show-statistics
coverage report
codecov
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install -r requirements-tests.txt
pip install --upgrade .
- name: Run pylint
run: |
pylint --disable=fixme --fail-under=8.0 hypothesis_networkx tests
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest
pylint
coverage
codecov
1 change: 1 addition & 0 deletions tests/test_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from hypothesis import given, settings, HealthCheck, note

import networkx as nx
import pytest

from hypothesis_networkx import graph_builder

Expand Down

0 comments on commit 21ef189

Please sign in to comment.