Skip to content

Commit 285667f

Browse files
committed
Integrate new CLI
Signed-off-by: Erik Jaegervall <[email protected]>
1 parent 88b54b8 commit 285667f

File tree

3 files changed

+33
-50
lines changed

3 files changed

+33
-50
lines changed

.github/workflows/buildcheck.yml

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,53 +15,30 @@ jobs:
1515
with:
1616
submodules: true
1717

18-
- name: Install pyenv
19-
run: |
20-
# Needed for using exact python version, which is
21-
# required in `Pipfile`.
22-
# Make sure it is aligned with vss-tools/Pipfile
23-
curl https://pyenv.run | bash
24-
export PATH="$HOME/.pyenv/bin:$PATH"
25-
pyenv install 3.10.6
26-
2718
- name: Install vss-tools dependencies
19+
# For most Makefile actions we use global install
2820
run: |
2921
python -V
3022
python -m pip --quiet --no-input install --upgrade pip
31-
python -m pip --quiet --no-input install --upgrade pipenv wheel
32-
pipenv --version
33-
pipenv run python --version
23+
python -m pip --quiet --no-input install --upgrade wheel
3424
cd vss-tools
25+
pip install -e .
3526
sudo apt install -y protobuf-compiler
36-
pipenv install
3727
echo done!
38-
pipenv run python setup.py install
39-
env:
40-
PIPENV_VENV_IN_PROJECT: 1
4128
42-
- name: Test mandatory targets
43-
run: |
44-
pipenv install
45-
pipenv run make mandatory_targets
46-
env:
47-
PIPENV_PIPFILE: ./vss-tools/Pipfile
48-
PIPENV_VENV_IN_PROJECT: 1
29+
- name: Install poetry
30+
# We use poetry only for testing, used in Makefile
31+
uses: abatilo/actions-poetry@v2
32+
with:
33+
poetry-version: "1.8.3"
4934

50-
- name: Test that ddsidl is correct
35+
- name: Test mandatory targets
5136
run: |
52-
# Ignore vss-tools Pipfile for this use-case
53-
pipenv install --ignore-pipfile cyclonedds
54-
pipenv run idlc *.idl
55-
env:
56-
PIPENV_VENV_IN_PROJECT: 1
37+
make mandatory_targets
5738
5839
- name: Test optional targets. NOTE - always succeeds
5940
run: |
60-
pipenv install
61-
pipenv run make -k optional_targets || true
62-
env:
63-
PIPENV_PIPFILE: ./vss-tools/Pipfile
64-
PIPENV_VENV_IN_PROJECT: 1
41+
make -k optional_targets || true
6542
6643
- name: Install hugo
6744
env:

Makefile

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
22
# Makefile to generate specifications
3+
# NOTE: You must have installed vss-tools before using this Makefile, see README
34
#
45

56
.PHONY: clean all mandatory_targets json franca yaml csv ddsidl tests binary protobuf ttl graphql ocf c overlays id jsonschema
@@ -20,53 +21,58 @@ optional_targets: clean protobuf ttl
2021

2122
TOOLSDIR?=./vss-tools
2223
COMMON_ARGS=-u ./spec/units.yaml --strict
24+
COMMON_VSPEC_ARG=-s ./spec/VehicleSignalSpecification.vspec
2325

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

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

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

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

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

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

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

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

5153
tests:
52-
PYTHONPATH=${TOOLSDIR} pytest
54+
cd ${TOOLSDIR}/binary && $(MAKE)
55+
# Minimize risk for involuntary line breaks affecting test results
56+
export COLUMNS=200
57+
cd ${TOOLSDIR} && poetry install
58+
cd ${TOOLSDIR} && poetry run pytest --cov=vss_tools --cov-report=term-missing --cov-fail-under=90
5359

5460
binary:
5561
cd ${TOOLSDIR}/binary && $(MAKE)
56-
${TOOLSDIR}/vspec2binary.py ${COMMON_ARGS} ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).binary
62+
vspec export binary ${COMMON_ARGS} ${COMMON_VSPEC_ARG} --bintool-dll ${TOOLSDIR}/binary/binarytool.so -o vss_rel_$$(cat VERSION).binary
5763

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

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

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

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

7177
clean:
7278
cd ${TOOLSDIR}/binary && $(MAKE) clean

vss-tools

Submodule vss-tools updated 109 files

0 commit comments

Comments
 (0)