Apply suggestions from code review #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: Sigma Rule Tests | |
on: | |
push: | |
branches: | |
- "*" | |
paths: | |
- ".github/workflows/sigma-test.yml" | |
- "deprecated/**.yml" | |
- "rules-compliance/**.yml" | |
- "rules-dfir/**.yml" | |
- "rules-emerging-threats/**.yml" | |
- "rules-placeholder/**.yml" | |
- "rules-threat-hunting/**.yml" | |
- "rules/**.yml" | |
- "tests/test_logsource.py" | |
- "tests/test_rules.py" | |
- "unsupported/**.yml" | |
pull_request: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/sigma-test.yml" | |
- "deprecated/**.yml" | |
- "rules-compliance/**.yml" | |
- "rules-dfir/**.yml" | |
- "rules-emerging-threats/**.yml" | |
- "rules-placeholder/**.yml" | |
- "rules-threat-hunting/**.yml" | |
- "rules/**.yml" | |
- "tests/test_logsource.py" | |
- "tests/test_rules.py" | |
- "unsupported/**.yml" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
yamllint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: yaml-lint | |
uses: ibiqlik/action-yamllint@v3 | |
test-sigma-logsource: | |
runs-on: ubuntu-latest | |
needs: yamllint | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: true | |
- name: Set up Python 3.11 | |
uses: actions/[email protected] | |
with: | |
python-version: 3.11 | |
- name: Test Sigma logsource | |
run: | | |
pip install PyYAML colorama | |
python tests/test_logsource.py | |
test-sigma: | |
runs-on: ubuntu-latest | |
needs: test-sigma-logsource | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: true | |
- name: Set up Python 3.11 | |
uses: actions/[email protected] | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
# pip install sigma-cli~=0.7.1 | |
pip install sigma-cli | |
- name: Test Sigma Rule Syntax | |
run: | | |
sigma check --fail-on-error --fail-on-issues --validation-config tests/sigma_cli_conf.yml rules* | |
- name: Test Sigma Rules | |
run: | | |
pip install PyYAML colorama | |
python tests/test_rules.py |