Skip to content

Commit

Permalink
Merge pull request #9 from melexis/move-to-gh-actions
Browse files Browse the repository at this point in the history
Move from Travis CI to GitHub Actions
  • Loading branch information
Letme authored Sep 19, 2022
2 parents ce1a3eb + 987069b commit 43ebd5a
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 68 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test and deploy on tag

on: push

jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Run test
run: tox -e py

deploy:

if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

16 changes: 16 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
:target: https://opensource.org/licenses/Apache-2.0
:alt: Apache 2.0 License

.. image:: https://badge.fury.io/py/mlx.jira-traceability.svg
:target: https://badge.fury.io/py/mlx.jira-traceability
:alt: PyPI packaged release

.. image:: https://github.com/melexis/jira-traceability/actions/workflows/python-package.yml/badge.svg?branch=main
:target: https://github.com/melexis/jira-traceability/actions/workflows/python-package.yml
:alt: Build status

.. image:: https://img.shields.io/badge/contributions-welcome-brightgreen.svg
:target: https://github.com/melexis/jira-traceability/issues
:alt: Contributions welcome

============
Introduction
============
Expand Down
6 changes: 3 additions & 3 deletions mlx/jira_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def create_unique_issues(item_ids, jira, general_fields, settings, traceability_

fields['project'] = project_id_or_key
fields[jira_field_id] = jira_field
body = item.get_content()
body = item.content
if not body:
body = item.caption

Expand Down Expand Up @@ -122,14 +122,14 @@ def push_item_to_jira(jira, fields, item, attendees, assignee):
try:
issue.update(update={"timetracking": [{"edit": {"originalEstimate": effort}}]})
except JIRAError:
issue.update(description="{}\n\nEffort estimate: {}".format(item.get_content(), effort))
issue.update(description="{}\n\nEffort estimate: {}".format(item.content, effort))

for attendee in attendees:
try:
jira.add_watcher(issue, attendee.strip())
except JIRAError as err:
LOGGER.warning("Jira interaction failed: item {}: error code {}: {}"
.format(item.id, err.status_code, err.response.text))
.format(item.identifier, err.status_code, err.response.text))

if assignee:
jira.assign_issue(issue, assignee)
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

project_url = 'https://github.com/melexis/jira-traceability'

requires = ['Sphinx>=2.1', 'jira', 'mlx.traceability>=6.0.0']
requires = ['Sphinx>=2.1', 'jira', 'mlx.traceability>=9.0.0']

setup(
name='mlx.jira-traceability',
Expand All @@ -28,17 +28,19 @@
'Operating System :: OS Independent',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Automation',
'Topic :: Documentation',
'Topic :: Utilities',
],
platforms='any',
packages=find_packages(exclude=['tests', 'doc']),
include_package_data=True,
install_requires=requires,
python_requires='>=3.7',
namespace_packages=['mlx'],
keywords=[
'traceability',
Expand Down
13 changes: 11 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
[tox]
envlist =
py37, py38, py39, py10
clean,
check,
{py37},
requires =
pip>=20.3.4

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv]
basepython =
py: python3
pypy: {env:TOXPYTHON:pypy}
py35: {env:TOXPYTHON:python3.5}
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
{clean,check,report,coveralls,codecov}: python3
setenv =
PYTHONPATH={toxinidir}/tests
Expand Down

0 comments on commit 43ebd5a

Please sign in to comment.