Skip to content

Generate the event projection instead of hand-writing it #11

Generate the event projection instead of hand-writing it

Generate the event projection instead of hand-writing it #11

# Runs the SentinelOps backend (pytest) and frontend (node --test) suites.
# See: https://docs.github.com/en/actions/automating-builds-and-tests
name: Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
backend:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Must match the minimum documented in README.md (Python 3.10 or newer).
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# Stop the build on syntax errors or undefined names.
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Style findings are advisory only.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: pytest
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Run frontend tests
working-directory: v2.0
run: npm test