Skip to content

Commit

Permalink
Adding sanity check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mmolenda committed Feb 1, 2024
1 parent 806f797 commit 426d977
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run sanity check

on:
push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Set PYTHONPATH
run: echo "PYTHONPATH=/home/runner/work/CU-GIR/CU-GIR" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install stix2==3.0.1 pytest
- name: Test with pytest
run: |
pytest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
tests/__pycache__
Empty file added tests/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions tests/test_sanity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import json
import os

import pytest
from stix2 import parse


HERE = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(HERE, "..", "STIX", "Current", "intel471_cu-gir.json")) as fh:
girs = json.load(fh)


@pytest.mark.parametrize("gir", girs)
def test_sanity(gir):
parse(gir, allow_custom=True)


0 comments on commit 426d977

Please sign in to comment.