Update/validator #23
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@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install black | |
run: pip install black==23.11.0 | |
- name: Check black format | |
run: black --check --diff --exclude "(open-simulation-interface|proto2cpp|venv)" . | |
- name: Install vulture | |
run: pip install vulture==2.10 | |
- 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'] | |
name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }}" | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install required protobuf version | |
shell: bash | |
run: | | |
sudo apt-get install python3-pip protobuf-compiler | |
- name: Install osi validator | |
shell: bash | |
run: | | |
git submodule update --init | |
python -m pip install --upgrade pip | |
sudo apt-get update -y | |
sudo apt-get install virtualenv | |
virtualenv -p /usr/bin/python3 venv | |
source venv/bin/activate | |
cd open-simulation-interface && pip install . && cd .. | |
pip install -r requirements.txt | |
- name: Generate parsed rules | |
run: python rules2yml.py -d rules | |
- name: Check rule correctness with unittests | |
run: python -m unittest discover tests | |
- name: Run osi-validator | |
run: | | |
osivalidator --data data/small_test.txt -r rules | |
osivalidator --date data/small_test.txt -r rules --parallel |