-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (67 loc) · 2.03 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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