forked from COVESA/vss-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (93 loc) · 2.74 KB
/
buildcheck.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Standard Build Check
on:
push:
branches: [master]
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:
concurrency:
group: ci-check-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10.6" # keep in sync with vss-tools/Pipfile!
CI: 1 # shall any script needs to know if it's running in the CI
jobs:
buildtest:
runs-on: ubuntu-latest
steps:
- name: Checkout vss-tools
uses: actions/checkout@v4
- name: Install apt dependencies
run: sudo apt install -y protobuf-compiler
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.8.3"
- name: Poetry install
run: poetry install
- name: Mypy
run: poetry run mypy src
- name: flake8
run: |
poetry run flake8 src tests contrib
- name: Build binary library (Needed for pytest)
run: |
cd binary
make
- name: Run tests
run: |
poetry run pytest --cov=vss_tools --cov-report=term-missing --cov-fail-under=90
- name: Test Binary Go Parser
run: |
cd binary/go_parser
go build -o gotestparser testparser.go
go list -m -json -buildvcs=false all
pypitest:
name: Test PyPI packaging
runs-on: ubuntu-latest
steps:
- name: Checkout vss-tools
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.8.3"
- name: Test Pypi packaging
run: |
poetry build
- name: Test that tools can be started
run: |
pip install dist/*.whl
# Verify that it works from any directory
mkdir /tmp/pypi_vss_test
cd /tmp/pypi_vss_test
# Just verify that we can start the tools
vspec --help
vspec export --help
vspec export csv --help
vspec export json --help
vspec export yaml --help
vspec export franca --help
vspec export ddsidl --help
vspec export protobuf --help
vspec export graphql --help
- name: Test that generated DDSIDL is correct
run: |
pip install cyclonedds
cd tests/ddsidl
vspec export ddsidl -u ../vspec/test_units.yaml -s test.vspec -o test.idl
idlc -l py test.idl
grep -i A.String A/_test.py