From dc0a275bbee483552b31364c7eca7de675a3c3bd Mon Sep 17 00:00:00 2001 From: Ross Wolf <31489089+rw-access@users.noreply.github.com> Date: Mon, 29 Jun 2020 23:25:38 -0600 Subject: [PATCH] Integrate with GitHub actions --- .github/CODEOWNERS | 13 ++++++++++ .github/workflows/pythonpackage.yml | 37 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/pythonpackage.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..142cedc6f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,13 @@ +# detection-rules code owners +# POC: Elastic Security Intelligence and Analytics Team + +tests/**/*.py @brokensound77 @rw-access +detection_rules/ @brokensound77 @rw-access +tests/ @brokensound77 @rw-access + +# skip rta-mapping to avoid the spam +etc/packages.yml @brokensound77 @rw-access +etc/*.json @brokensound77 @rw-access +etc/*.json @brokensound77 @rw-access +etc/*/* @brokensound77 @rw-access + diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml new file mode 100644 index 000000000..c4de9a5f5 --- /dev/null +++ b/.github/workflows/pythonpackage.yml @@ -0,0 +1,37 @@ +name: Unit Tests + +on: + push: + branches: [ master, dev, feature/* ] + pull_request: + branches: [ "*" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Python Lint + run: | + python -m flake8 tests detection_rules --ignore D203 --max-line-length 120 + + - name: Python License Check + run: | + python -m detection_rules license-check + + - name: Unit tests + run: | + python -m detection_rules test