Skip to content

Commit

Permalink
Integrate new CLI
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Jaegervall <[email protected]>
  • Loading branch information
erikbosch committed Jul 22, 2024
1 parent 88b54b8 commit 8309523
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 53 deletions.
45 changes: 11 additions & 34 deletions .github/workflows/buildcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,30 @@ jobs:
with:
submodules: true

- name: Install pyenv
run: |
# Needed for using exact python version, which is
# required in `Pipfile`.
# Make sure it is aligned with vss-tools/Pipfile
curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
pyenv install 3.10.6
- name: Install vss-tools dependencies
# For most Makefile actions we use global install
run: |
python -V
python -m pip --quiet --no-input install --upgrade pip
python -m pip --quiet --no-input install --upgrade pipenv wheel
pipenv --version
pipenv run python --version
python -m pip --quiet --no-input install --upgrade wheel
cd vss-tools
pip install -e .
sudo apt install -y protobuf-compiler
pipenv install
echo done!
pipenv run python setup.py install
env:
PIPENV_VENV_IN_PROJECT: 1
- name: Test mandatory targets
run: |
pipenv install
pipenv run make mandatory_targets
env:
PIPENV_PIPFILE: ./vss-tools/Pipfile
PIPENV_VENV_IN_PROJECT: 1
- name: Install poetry
# We use poetry only for testing, used in Makefile
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.8.3"

- name: Test that ddsidl is correct
- name: Test mandatory targets
run: |
# Ignore vss-tools Pipfile for this use-case
pipenv install --ignore-pipfile cyclonedds
pipenv run idlc *.idl
env:
PIPENV_VENV_IN_PROJECT: 1
make mandatory_targets
- name: Test optional targets. NOTE - always succeeds
run: |
pipenv install
pipenv run make -k optional_targets || true
env:
PIPENV_PIPFILE: ./vss-tools/Pipfile
PIPENV_VENV_IN_PROJECT: 1
make -k optional_targets || true
- name: Install hugo
env:
Expand Down
39 changes: 21 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,53 +20,56 @@ optional_targets: clean protobuf ttl

TOOLSDIR?=./vss-tools
COMMON_ARGS=-u ./spec/units.yaml --strict
COMMON_VSPEC_ARG=-s ./spec/VehicleSignalSpecification.vspec

json:
${TOOLSDIR}/vspec2json.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).json
vspec export json ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).json

json-noexpand:
${TOOLSDIR}/vspec2json.py ${COMMON_ARGS} --no-expand ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION)_noexpand.json
vspec export json ${COMMON_ARGS} --no-expand ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_noexpand.json

jsonschema:
${TOOLSDIR}/vspec2jsonschema.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).jsonschema
vspec export jsonschema ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).jsonschema

franca:
${TOOLSDIR}/vspec2franca.py --franca-vss-version $$(cat VERSION) ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).fidl
vspec export franca --franca-vss-version $$(cat VERSION) ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).fidl

yaml:
${TOOLSDIR}/vspec2yaml.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).yaml
vspec export yaml ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).yaml

csv:
${TOOLSDIR}/vspec2csv.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).csv
vspec export csv ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).csv

ddsidl:
${TOOLSDIR}/vspec2ddsidl.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).idl
vspec export ddsidl ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).idl

# Verifies that supported overlay combinations are syntactically correct.
overlays:
${TOOLSDIR}/vspec2json.py ${COMMON_ARGS} -o overlays/profiles/motorbike.vspec ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION)_motorbike.json
${TOOLSDIR}/vspec2json.py ${COMMON_ARGS} -o overlays/extensions/dual_wiper_systems.vspec ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION)_dualwiper.json
${TOOLSDIR}/vspec2json.py ${COMMON_ARGS} -o overlays/extensions/OBD.vspec ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION)_obd.json
vspec export json ${COMMON_ARGS} -l overlays/profiles/motorbike.vspec ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_motorbike.json
vspec export json ${COMMON_ARGS} -l overlays/extensions/dual_wiper_systems.vspec ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_dualwiper.json
vspec export json ${COMMON_ARGS} -l overlays/extensions/OBD.vspec ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_obd.json

tests:
PYTHONPATH=${TOOLSDIR} pytest

binary:
prepare_binary:
cd ${TOOLSDIR}/binary && $(MAKE)
${TOOLSDIR}/vspec2binary.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).binary

tests: prepare_binary
COLUMNS=200 PYTHONPATH=${TOOLSDIR} pytest

binary: prepare_binary
vspec export binary ${COMMON_ARGS} ${COMMON_VSPEC_ARG} --bintool-dll ${TOOLSDIR}/binary/binarytool.so -o vss_rel_$$(cat VERSION).binary

protobuf:
${TOOLSDIR}/vspec2protobuf.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).proto
vspec export protobuf ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).proto

graphql:
${TOOLSDIR}/vspec2graphql.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).graphql.ts
vspec export graphql ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).graphql.ts

# vspec2ttl does not use common generator framework
ttl:
${TOOLSDIR}/contrib/vspec2ttl/vspec2ttl.py -u ./spec/units.yaml ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).ttl

id:
${TOOLSDIR}/vspec2id.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).vspec
vspec export id ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).vspec

clean:
cd ${TOOLSDIR}/binary && $(MAKE) clean
Expand Down
2 changes: 1 addition & 1 deletion vss-tools
Submodule vss-tools updated 109 files

0 comments on commit 8309523

Please sign in to comment.