-
Notifications
You must be signed in to change notification settings - Fork 6
211 lines (205 loc) · 13.3 KB
/
codegen.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Code Generation
# avoiding duplicate jobs on push with open pull_request: https://github.com/orgs/community/discussions/26940#discussioncomment-6656489
on: [push, pull_request]
jobs:
build-docker-images:
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)
name: build-docker-images
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to Docker registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build asn1c docker image
uses: docker/build-push-action@v6
with:
context: utils/codegen/asn1ToC/docker
file: utils/codegen/asn1ToC/docker/asn1c.Dockerfile
tags: asn1c:ci
outputs: type=docker,dest=/tmp/asn1c-image.tar
- name: Upload asn1c-image (artifact)
uses: actions/upload-artifact@v4
with:
name: asn1c-image
path: /tmp/asn1c-image.tar
- name: Build rgen docker image
uses: docker/build-push-action@v6
with:
context: utils/codegen/codegen-rust
file: utils/codegen/codegen-rust/docker/rgen.Dockerfile
tags: rgen:ci
outputs: type=docker,dest=/tmp/rgen-image.tar
- name: Upload rgen-image (artifact)
uses: actions/upload-artifact@v4
with:
name: rgen-image
path: /tmp/rgen-image.tar
- name: Push Docker Images
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
run: |
docker load --input /tmp/asn1c-image.tar
docker tag asn1c:ci ghcr.io/${{ github.repository }}:asn1c
docker push ghcr.io/${{ github.repository }}:asn1c
docker load --input /tmp/rgen-image.tar
docker tag rgen:ci ghcr.io/${{ github.repository }}:rgen
docker push ghcr.io/${{ github.repository }}:rgen
etsi_its_coding:
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)
name: asn1c
runs-on: ubuntu-latest
needs: build-docker-images
strategy:
matrix:
include:
- message: cam
script: ./utils/codegen/asn1ToC/asn1ToC.py asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn asn1/raw/cam_en302637_2/cdd/ITS-Container.asn -t cam -o etsi_its_coding/etsi_its_cam_coding -di asn1c:ci
- message: cam_ts
script: ./utils/codegen/asn1ToC/asn1ToC.py asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn -t cam_ts -o etsi_its_coding/etsi_its_cam_ts_coding -di asn1c:ci
- message: denm
script: ./utils/codegen/asn1ToC/asn1ToC.py asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn asn1/raw/denm_en302637_3/cdd/ITS-Container.asn -t denm -o etsi_its_coding/etsi_its_denm_coding -di asn1c:ci
- message: cpm_ts
script: ./utils/codegen/asn1ToC/asn1ToC.py asn1/raw/cpm_ts103324/asn/CPM-PDU-Descriptions.asn asn1/raw/cpm_ts103324/asn/CPM-OriginatingStationContainers.asn asn1/raw/cpm_ts103324/asn/CPM-PerceivedObjectContainer.asn asn1/raw/cpm_ts103324/asn/CPM-PerceptionRegionContainer.asn asn1/raw/cpm_ts103324/asn/CPM-SensorInformationContainer.asn asn1/patched/cpm_ts103324/asn/cdd/ETSI-ITS-CDD.asn -t cpm_ts -o etsi_its_coding/etsi_its_cpm_ts_coding -di asn1c:ci
- message: mapem_ts
script: ./utils/codegen/asn1ToC/asn1ToC.py asn1/raw/is_ts103301/MAPEM-PDU-Descriptions.asn asn1/raw/is_ts103301/cdd/ITS-Container.asn asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn -t mapem_ts -o etsi_its_coding/etsi_its_mapem_ts_coding -di asn1c:ci
- message: spatem_ts
script: ./utils/codegen/asn1ToC/asn1ToC.py asn1/raw/is_ts103301/SPATEM-PDU-Descriptions.asn asn1/raw/is_ts103301/cdd/ITS-Container.asn asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn -t spatem_ts -o etsi_its_coding/etsi_its_spatem_ts_coding -di asn1c:ci
- message: vam_ts
script: ./utils/codegen/asn1ToC/asn1ToC.py asn1/raw/vam-ts103300_3/VAM-PDU-Descriptions.asn asn1/patched/vam-ts103300_3/cdd/ETSI-ITS-CDD.asn -t vam_ts -o etsi_its_coding/etsi_its_vam_ts_coding -di asn1c:ci
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Download asn1c-image (artifact)
uses: actions/download-artifact@v4
with:
name: asn1c-image
path: /tmp
- name: Load asn1c-image
run: docker load --input /tmp/asn1c-image.tar
- name: etsi_its_${{ matrix.message }}_coding
run: |
./asn1/external/download.sh
./asn1/patches/patch.sh
${{ matrix.script }}
rm -rf ${{ github.workspace }}/tmp
if [[ ! -z "$(git status --porcelain)" ]]; then
echo "Code generation script resulted in changes to the repository"
git diff
exit 1
fi
etsi_its_msgs:
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)
name: ROS Messages
runs-on: ubuntu-latest
needs: build-docker-images
strategy:
matrix:
include:
- message: cam
script: ./utils/codegen/codegen-py/asn1ToRosMsg.py asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn asn1/raw/cam_en302637_2/cdd/ITS-Container.asn -t cam -o etsi_its_msgs/etsi_its_cam_msgs/msg
- message: cam_ts
script: ./utils/codegen/codegen-py/asn1ToRosMsg.py asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn -t cam_ts -o etsi_its_msgs/etsi_its_cam_ts_msgs/msg
- message: denm
script: ./utils/codegen/codegen-py/asn1ToRosMsg.py asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn asn1/raw/denm_en302637_3/cdd/ITS-Container.asn -t denm -o etsi_its_msgs/etsi_its_denm_msgs/msg
- message: cpm_ts
script: ./utils/codegen/codegen-py/asn1ToRosMsg.py asn1/raw/cpm_ts103324/asn/CPM-PDU-Descriptions.asn asn1/raw/cpm_ts103324/asn/CPM-OriginatingStationContainers.asn asn1/raw/cpm_ts103324/asn/CPM-PerceivedObjectContainer.asn asn1/raw/cpm_ts103324/asn/CPM-PerceptionRegionContainer.asn asn1/raw/cpm_ts103324/asn/CPM-SensorInformationContainer.asn asn1/patched/cpm_ts103324/asn/cdd/ETSI-ITS-CDD.asn -t cpm_ts -o etsi_its_msgs/etsi_its_cpm_ts_msgs/msg
- message: mapem_ts
script: ./utils/codegen/codegen-py/asn1ToRosMsg.py asn1/raw/is_ts103301/MAPEM-PDU-Descriptions.asn asn1/raw/is_ts103301/cdd/ITS-Container.asn asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn -t mapem_ts -o etsi_its_msgs/etsi_its_mapem_ts_msgs/msg
- message: spatem_ts
script: ./utils/codegen/codegen-py/asn1ToRosMsg.py asn1/raw/is_ts103301/SPATEM-PDU-Descriptions.asn asn1/raw/is_ts103301/cdd/ITS-Container.asn asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn -t spatem_ts -o etsi_its_msgs/etsi_its_spatem_ts_msgs/msg
- message: vam_ts
script: ./utils/codegen/codegen-py/asn1ToRosMsg.py asn1/raw/vam-ts103300_3/VAM-PDU-Descriptions.asn asn1/patched/vam-ts103300_3/cdd/ETSI-ITS-CDD.asn -t vam_ts -o etsi_its_msgs/etsi_its_vam_ts_msgs/msg
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip
- name: Install dependencies
run: pip install -r ./utils/codegen/codegen-py/requirements.txt
- name: Download rgen-image (artifact)
uses: actions/download-artifact@v4
with:
name: rgen-image
path: /tmp
- name: Load rgen-image
run: docker load --input /tmp/rgen-image.tar
- name: etsi_its_${{ matrix.message }}_msgs
run: |
./asn1/external/download.sh
./asn1/patches/patch.sh
${{ matrix.script }}
if [[ ! -z "$(git status --porcelain)" ]]; then
echo "Code generation script resulted in changes to the repository"
git diff
exit 1
fi
etsi_its_conversion:
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)
name: Conversion Headers
runs-on: ubuntu-latest
needs: build-docker-images
strategy:
matrix:
include:
- message: cam
script: ./utils/codegen/codegen-py/asn1ToConversionHeader.py asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn asn1/raw/cam_en302637_2/cdd/ITS-Container.asn -t cam -o etsi_its_conversion/etsi_its_cam_conversion/include/etsi_its_cam_conversion
- message: cam_ts
script: ./utils/codegen/codegen-py/asn1ToConversionHeader.py asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn -t cam_ts -o etsi_its_conversion/etsi_its_cam_ts_conversion/include/etsi_its_cam_ts_conversion
- message: denm
script: ./utils/codegen/codegen-py/asn1ToConversionHeader.py asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn asn1/raw/denm_en302637_3/cdd/ITS-Container.asn -t denm -o etsi_its_conversion/etsi_its_denm_conversion/include/etsi_its_denm_conversion
- message: cpm_ts
script: ./utils/codegen/codegen-py/asn1ToConversionHeader.py asn1/raw/cpm_ts103324/asn/CPM-PDU-Descriptions.asn asn1/raw/cpm_ts103324/asn/CPM-OriginatingStationContainers.asn asn1/raw/cpm_ts103324/asn/CPM-PerceivedObjectContainer.asn asn1/raw/cpm_ts103324/asn/CPM-PerceptionRegionContainer.asn asn1/raw/cpm_ts103324/asn/CPM-SensorInformationContainer.asn asn1/patched/cpm_ts103324/asn/cdd/ETSI-ITS-CDD.asn -t cpm_ts -o etsi_its_conversion/etsi_its_cpm_ts_conversion/include/etsi_its_cpm_ts_conversion
- message: mapem_ts
script: ./utils/codegen/codegen-py/asn1ToConversionHeader.py asn1/raw/is_ts103301/MAPEM-PDU-Descriptions.asn asn1/raw/is_ts103301/cdd/ITS-Container.asn asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn -t mapem_ts -o etsi_its_conversion/etsi_its_mapem_ts_conversion/include/etsi_its_mapem_ts_conversion
- message: spatem_ts
script: ./utils/codegen/codegen-py/asn1ToConversionHeader.py asn1/raw/is_ts103301/SPATEM-PDU-Descriptions.asn asn1/raw/is_ts103301/cdd/ITS-Container.asn asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn -t spatem_ts -o etsi_its_conversion/etsi_its_spatem_ts_conversion/include/etsi_its_spatem_ts_conversion
- message: vam_ts
script: ./utils/codegen/codegen-py/asn1ToConversionHeader.py asn1/raw/vam-ts103300_3/VAM-PDU-Descriptions.asn asn1/patched/vam-ts103300_3/cdd/ETSI-ITS-CDD.asn -t vam_ts -o etsi_its_conversion/etsi_its_vam_ts_conversion/include/etsi_its_vam_ts_conversion
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip
- name: Install dependencies
run: pip install -r ./utils/codegen/codegen-py/requirements.txt
- name: Download rgen-image (artifact)
uses: actions/download-artifact@v4
with:
name: rgen-image
path: /tmp
- name: Load rgen-image
run: docker load --input /tmp/rgen-image.tar
- name: etsi_its_${{ matrix.message }}_conversion
run: |
./asn1/external/download.sh
./asn1/patches/patch.sh
${{ matrix.script }}
if [[ ! -z "$(git status --porcelain)" ]]; then
echo "Code generation script resulted in changes to the repository"
git diff
exit 1
fi