Update/validator #47
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
name: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
linter: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.8" | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: pip install -r requirements_develop.txt | |
- name: Check black format | |
run: black --check --diff --exclude "(open-simulation-interface|proto2cpp|.venv)" . | |
- name: Check dead code with vulture | |
run: vulture *.py tests/ osivalidator/ --min-confidence 100 | |
build-validator: | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: [ubuntu-latest] | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }}" | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install required protobuf version | |
shell: bash | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install protobuf-compiler | |
- name: Install osi validator | |
shell: bash | |
run: | | |
git submodule update --init | |
python -m pip install --upgrade pip | |
sudo apt-get update -y | |
python -m venv .venv | |
source .venv/bin/activate | |
cd open-simulation-interface && pip install . && cd .. | |
pip install -r requirements.txt | |
- name: Generate parsed rules | |
run: | | |
source .venv/bin/activate | |
python rules2yml.py -d rules | |
- name: Check rule correctness with unittests | |
run: | | |
source .venv/bin/activate | |
python -m unittest discover tests | |
- name: Run osi-validator | |
run: | | |
source .venv/bin/activate | |
pip install . | |
osivalidator --data data/20210818T150542Z_sv_312_50_one_moving_object.txt -r rules | |
osivalidator --data data/20210818T150542Z_sv_312_50_one_moving_object.txt -r rules --parallel | |
osivalidator --data data/20210818T150542Z_sv_312_50_one_moving_object.osi -r rules | |
osivalidator --data data/20210818T150542Z_sv_312_50_one_moving_object.osi -r rules --parallel |