Skip to content

Added gh_actions #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- v*

jobs:
linter:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install linter dependencies
run: |
pip install black
pip install vulture

- name: Check with black
run: black --check --exclude "(open-simulation-interface|proto2cpp)" .

- name: Check with vulture
run: vulture *.py tests/ osivalidator/ --min-confidence 100

build-osi-validator:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8, 3.9]

name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }}"
runs-on: ${{ matrix.runs-on }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Checkout submodules
uses: textbook/git-checkout-submodule-action@master
with:
remote: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install software dependencies
shell: bash
run: |
python -m pip install --upgrade pip
sudo apt-get update -y
sudo apt-get install python3-pip protobuf-compiler
cd open-simulation-interface
pip install .
cd ..
pip install .

- name: Display infos
shell: bash
run: |
lzma --version
protoc --version
osivalidator --help

- name: Test lzma compression and decompression
shell: bash
run: |
lzma -z data/small_test.txt
lzma -d data/small_test.txt.lzma

- name: Run tests
shell: bash
run: python -m unittest discover tests

- name: Generate rules
shell: bash
run: python open-simulation-interface/rules2yml.py -d rules

- name: Run validator with different options
shell: bash
run: |
python open-simulation-interface/format/txt2osi.py -d data/small_test.txt

osivalidator data/small_test.osi
osivalidator data/small_test.osi -p
osivalidator data/small_test.txt
osivalidator data/small_test.txt -p

osivalidator data/small_test.osi -r rules
osivalidator data/small_test.osi -p -r rules
osivalidator data/small_test.txt -r rules
osivalidator data/small_test.txt -p -r rules

lzma -z data/small_test.txt
lzma -z data/small_test.osi

osivalidator data/small_test.osi.lzma
osivalidator data/small_test.osi.lzma -p
osivalidator data/small_test.txt.lzma
osivalidator data/small_test.txt.lzma -p

osivalidator data/small_test.osi.lzma -r rules
osivalidator data/small_test.osi.lzma -p -r rules
osivalidator data/small_test.txt.lzma -r rules
osivalidator data/small_test.txt.lzma -p -r rules
90 changes: 0 additions & 90 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions data/small_test.txt
Git LFS file not shown
3 changes: 0 additions & 3 deletions data/small_test.txt.lzma

This file was deleted.

112 changes: 0 additions & 112 deletions osivalidator/osi_doxygen_xml.py

This file was deleted.

2 changes: 1 addition & 1 deletion osivalidator/osi_general_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def check_positive_int(value):


def command_line_arguments():
""" Define and handle command line interface """
"""Define and handle command line interface"""

dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))

Expand Down
3 changes: 1 addition & 2 deletions osivalidator/osi_id_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@


class OSIIDManager:
"""Manage the ID of OSI Messages for verification of unicity and references
"""
"""Manage the ID of OSI Messages for verification of unicity and references"""

def __init__(self, logger):
# id => [object1, object2...]
Expand Down
Loading