39b6f19eb9
Co-authored-by: Shashank K S <Shashank.Suryanarayana@elastic.co>
50 lines
1008 B
YAML
50 lines
1008 B
YAML
name: Code checks
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "7.*", "8.*", "9.*" ]
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
paths:
|
|
- 'detection_rules/**/*.py'
|
|
- 'hunting/**/*.py'
|
|
- 'tests/**/*.py'
|
|
- 'lib/**/*.py'
|
|
|
|
jobs:
|
|
code-checks:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Set up Python 3.13
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
with:
|
|
python-version: '3.13'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip cache purge
|
|
pip install .[dev]
|
|
|
|
- name: Linting check
|
|
run: |
|
|
ruff check --exit-non-zero-on-fix
|
|
|
|
- name: Formatting check
|
|
run: |
|
|
ruff format --check
|
|
|
|
- name: Pyright check
|
|
run: |
|
|
pyright
|
|
|
|
- name: Python License Check
|
|
run: |
|
|
python -m detection_rules dev license-check
|