Skip to content

Commit

Permalink
Merge pull request #57 from emmanvg/gh-migration
Browse files Browse the repository at this point in the history
GitHub Actions Migration
  • Loading branch information
emmanvg committed Jan 15, 2021
2 parents 71b0cf4 + ce5506e commit f370c93
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 48 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/python-ci-tests.yml
@@ -0,0 +1,33 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: cti-stix-slider test harness
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

name: Python ${{ matrix.python-version }} Build
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 and update essential dependencies
run: |
pip install -U pip setuptools
pip install tox-gh-actions
pip install codecov
- name: Test with Tox
run: |
tox
- name: Upload coverage information to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
19 changes: 14 additions & 5 deletions .pre-commit-config.yaml
@@ -1,14 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: v0.9.4
rev: v3.4.0
hooks:
- id: trailing-whitespace
exclude_types: [xml, json]
- id: check-merge-conflict
- repo: https://github.com/PyCQA/flake8
rev: 3.8.4
hooks:
- id: flake8
name: Check project styling
args:
- --max-line-length=160
- --ignore=F403,F405,W504
- id: check-merge-conflict
- repo: https://github.com/FalconSocial/pre-commit-python-sorter
sha: b57843b0b874df1d16eb0bef00b868792cb245c2
- repo: https://github.com/PyCQA/isort
rev: 5.7.0
hooks:
- id: python-import-sorter
- id: isort
name: Sort python imports (shows diff)
args: ["-c", "--diff"]
- id: isort
name: Sort python imports (fixes files)
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Expand Up @@ -35,7 +35,7 @@ ReadTheDocs.
Requirements
------------

- Python 3.5+
- Python 3.6+
- `python-stix <https://stix.readthedocs.io/en/stable/>`_ and its dependencies

.. note::
Expand Down Expand Up @@ -312,8 +312,8 @@ Staff at
repository-admin@oasis-open.org and any specific CLA-related questions
to repository-cla@oasis-open.org.

.. |Build_Status| image:: https://travis-ci.org/oasis-open/cti-stix-slider.svg?branch=master
:target: https://travis-ci.org/oasis-open/cti-stix-slider
.. |Build_Status| image:: https://github.com/oasis-open/cti-stix-slider/workflows/cti-stix-slider%20test%20harness/badge.svg
:target: https://github.com/oasis-open/cti-stix-slider/actions?query=workflow%3A%22cti-stix-slider+test+harness%22
.. |Coverage| image:: https://codecov.io/gh/oasis-open/cti-stix-slider/branch/master/graph/badge.svg
:target: https://codecov.io/gh/oasis-open/cti-stix-slider
.. |Version| image:: https://img.shields.io/pypi/v/stix2-slider.svg?maxAge=3600
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -31,6 +31,7 @@ def get_long_description():
version=get_version(),
description='Utilities to downgrade STIX and CybOX content to 1.X',
long_description=get_long_description(),
long_description_content_type='text/x-rst',
url='https://oasis-open.github.io/cti-documentation/',
author='OASIS Cyber Threat Intelligence Technical Committee',
author_email='cti-users@lists.oasis-open.org',
Expand All @@ -54,10 +55,10 @@ def get_long_description():
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'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',
],
keywords='stix stix2 json xml cti cyber threat intelligence',
project_urls={
Expand Down
35 changes: 13 additions & 22 deletions tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py{35,36,37,38}-stix{20,21},pycodestyle,isort-check,packaging
envlist = py{36,37,38,39}-stix{20,21},packaging,pre-commit-check

[testenv]
deps =
Expand All @@ -14,38 +14,29 @@ setenv =
commands =
py.test --cov=stix2slider stix2slider/test/ --cov-report term-missing

passenv = CI TRAVIS TRAVIS_*
passenv = GITHUB_*

[testenv:pycodestyle]
[testenv:packaging]
deps =
flake8
commands =
flake8 stix2slider

[testenv:isort-check]
deps = isort
twine
commands =
isort stix2slider --df
isort stix2slider -c
python setup.py sdist bdist_wheel --universal
twine check dist/*

[flake8]
ignore=F403,F405,W504
max-line-length=160

[testenv:packaging]
[testenv:pre-commit-check]
deps =
readme_renderer
pre-commit
commands =
python setup.py check -r -s
pre-commit run --all-files

[travis]
[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37
3.8: py38, pycodestyle, packaging
3.8: py38
3.9: py39, packaging, pre-commit-check

[travis:env]
[gh-actions:env]
VERSION =
2.0: stix20
2.1: stix21

0 comments on commit f370c93

Please sign in to comment.