Adjusting GHA for our use #4
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Tools | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- onboard-main | |
paths: | |
- 'tools/**' | |
pull_request: | |
branches: | |
- master | |
- main | |
- onboard-main | |
paths: | |
- 'tools/**' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
abel: | |
- 'tools/abel/**' | |
explorer: | |
- 'tools/explorer/**' | |
instance_guid_generator: | |
- 'tools/guid_generator/instance/**' | |
ontology_guid_generator: | |
- 'tools/guid_generator/ontology/**' | |
instance_validator: | |
- 'tools/validators/instance_validator/**' | |
rdf_generator: | |
- 'tools/rdf_generator/**' | |
type_validator: | |
- 'tools/validators/ontology_validator/**' | |
scoring: | |
- 'tools/scoring/**' | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.11' | |
- name: Install Pylint | |
run: | | |
python -m pip install pylint | |
#---------- Ontology Yaml Type Validator ----------# | |
- name: Ontology Yaml Type Validator Install dependencies | |
run: | | |
python setup.py install | |
working-directory: ./tools/validators/ontology_validator | |
- name: Run pylint on Ontology Type Validator | |
if: steps.changes.outputs.type_validator == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/validators/ontology_validator | |
- name: Ontology Yaml Validator Generator Tests | |
if: steps.changes.outputs.type_validator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/validators/ontology_validator | |
#---------- Ontology Yaml Instance Validator ----------# | |
- name: Instance Yaml Validator Install dependencies | |
run: | | |
python -m pip install . | |
working-directory: ./tools/validators/instance_validator | |
- name: Run pylint on Ontology Instance Validator | |
if: steps.changes.outputs.instance_validator == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/validators/instance_validator | |
- name: Instance Yaml Validator Unit Tests | |
if: steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/validators/instance_validator | |
- name: Instance Yaml Validator Integraion Test | |
if: steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true' | |
run: | | |
python instance_validator.py -i ../../abel/tests/test_resources/good_test_building_config.yaml | |
working-directory: ./tools/validators/instance_validator | |
- name: Correct Ontology Descriptions | |
run: | | |
pip install -r tools/spellcheck/requirements.txt | |
python tools/spellcheck/spellcheck.py | |
#---------- ABEL ----------# | |
- name: ABEL install dependencies | |
if: steps.changes.outputs.abel == 'true' || steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true' | |
run: | | |
python setup.py install | |
working-directory: ./tools/abel | |
- name: Run pylint on ABEL | |
if: steps.changes.outputs.abel == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/abel | |
- name: ABEL Unit Tests | |
if: steps.changes.outputs.abel == 'true' || steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/abel | |
#---------- Instance GUID Generator ----------# | |
- name: Instance GUID Generator Install dependencies | |
if: steps.changes.outputs.instance_guid_generator == 'true' || steps.changes.outputs.instance_validator == 'true' | |
run: | | |
python setup.py install | |
working-directory: ./tools/guid_generator/instance | |
- name: Run pylint on Instance GUID Generator | |
if: steps.changes.outputs.instance_guid_generator == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/guid_generator/instance | |
- name: Instance GUID Generator Tests | |
if: steps.changes.outputs.instance_guid_generator == 'true' || steps.changes.outputs.instance_validator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/guid_generator/instance | |
#---------- Ontology GUID Generator ----------# | |
- name: Ontology GUID Generator Install dependencies | |
if: steps.changes.outputs.ontology_guid_generator == 'true' || steps.changes.outputs.type_validator == 'true' | |
run: | | |
python setup.py install | |
working-directory: ./tools/guid_generator/ontology | |
- name: Run pylint on Ontology GUID Generator | |
if: steps.changes.outputs.ontology_guid_generator == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/guid_generator/ontology | |
- name: Ontology GUID Generator Tests | |
if: steps.changes.outputs.ontology_guid_generator == 'true' || steps.changes.outputs.type_validator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/guid_generator/ontology | |
#---------- RDF Generator ----------# | |
- name: RDF Generator Install dependencies | |
if: steps.changes.outputs.rdf_generator == 'true' | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py install | |
working-directory: ./tools/rdf_generator | |
- name: Run pylint on RDF Generator | |
if: steps.changes.outputs.rdf_generator == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/rdf_generator | |
- name: RDF Generator Tests | |
if: steps.changes.outputs.rdf_generator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/rdf_generator/rdfformat/tests | |
#---------- Ontology Explorer ----------# | |
- name: Ontology Explorer Install dependencies | |
if: steps.changes.outputs.explorer == 'true' || steps.changes.outputs.type_validator == 'true' || steps.changes.outputs.instance_validator == 'true' | |
run: | | |
python setup.py install | |
working-directory: ./tools/explorer | |
- name: Run pylint on Ontology Explorer | |
if: steps.changes.outputs.explorer == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/explorer | |
- name: Ontology Explorer Tests | |
if: steps.changes.outputs.explorer == 'true' || steps.changes.outputs.type_validator == 'true' || steps.changes.outputs.instance_validator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/explorer | |
#---------- Configuration scoring ----------# | |
- name: Configuration scoring Install dependencies | |
if: steps.changes.outputs.scoring == 'true' || steps.changes.outputs.instance_validator == 'true' | |
run: | | |
python setup.py install | |
working-directory: ./tools/scoring | |
- name: Run pylint on Configuration Scorer | |
if: steps.changes.outputs.scoring == 'true' | |
run: | | |
pylint --rcfile ./styles/pylintrc ./tools/scoring | |
- name: Configuration Scorer Tests | |
if: steps.changes.outputs.scoring == 'true' || steps.changes.outputs.instance_validator == 'true' | |
run: | | |
python -m unittest discover -p '*_test.py' --failfast -v | |
working-directory: ./tools/scoring |