Skip to content

Commit

Permalink
Merge pull request #20 from clenk/cui-extension
Browse files Browse the repository at this point in the history
Update CUI tox config for consistency
  • Loading branch information
rpiazza authored Feb 9, 2024
2 parents f280d19 + f03bb8b commit a725efb
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ on:
push:
paths:
- '**.py'
- '**/tox.ini'
- '**/pyproject.toml'
- '.github/workflows/**.yml'
pull_request:
paths:
- '**.py'
- '**/tox.ini'
- '**/pyproject.toml'
- '.github/workflows/**.yml'

jobs:
build:
Expand Down Expand Up @@ -34,13 +40,35 @@ jobs:
- 'incident-ef7/**'
observed-string-8b1:
- 'observed-string-8b1/**'
cui-marking-definition-dff:
- 'cui-marking-definition-dff/**'
- name: Test incident-ef7 with Tox
if: ${{ steps.filter.outputs.incident-ef7 == 'true' }}
run: |
tox -c incident-ef7/tox.ini
- name: Skip testing incident-ef7 with Tox
if: ${{ steps.filter.outputs.incident-ef7 !== 'true' }}
run: |
echo "Skipped incident-ef7 tests due to no changes"
- name: Test observed-string-8b1 with Tox
if: ${{ steps.filter.outputs.observed-string-8b1 == 'true' }}
run: |
tox -c observed-string-8b1/tox.ini
- name: Skip testing observed-string-8b1 with Tox
if: ${{ steps.filter.outputs.observed-string-8b1 != 'true' }}
run: |
echo "Skipped observed-string-8b1 tests due to no changes"
- name: Test cui-marking-definition-dff with Tox
if: ${{ steps.filter.outputs.cui-marking-definition-dff == 'true' }}
run: |
tox -c cui-marking-definition-dff/tox.ini
- name: Skip testing cui-marking-definition-dff with Tox
if: ${{ steps.filter.outputs.cui-marking-definition-dff != 'true' }}
run: |
echo "Skipped cui-marking-definition-dff tests due to no changes"
22 changes: 22 additions & 0 deletions .github/workflows/tests_skipped.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: cti-python-stix2-extensions tests were skipped
on:
push:
paths:
- '!**.py'
- '!**/tox.ini'
- '!**/pyproject.toml'
- '!.github/workflows/**.yml'
pull_request:
paths:
- '!**.py'
- '!**/tox.ini'
- '!**/pyproject.toml'
- '!.github/workflows/**.yml'

jobs:
log:
runs-on: ubuntu-latest
steps:
- run: |
echo "No code changes found to test for any extension"
6 changes: 6 additions & 0 deletions cui-marking-definition-dff/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ dev = ["pytest", "tox"]

[tool.pytest.ini_options]
addopts = "--import-mode=importlib"

[tool.ruff.lint]
extend-select = ["E501"]

[tool.ruff.lint.pycodestyle]
max-line-length = 160
9 changes: 5 additions & 4 deletions cui-marking-definition-dff/tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[tox]
envlist = py38,py39,py310,py311,py312,style
envlist = py{38,39,310,311,312},style

[testenv]
[testenv:py{38,39,310,311,312}]
extras = dev
deps =
pytest-cov

commands =
python -m pytest --cov=cui --cov-report=term-missing tests/

[style]
[testenv:style]
skip_install = true
deps =
ruff
commands =
ruff . --line-length 160
ruff check ./src ./tests

0 comments on commit a725efb

Please sign in to comment.