-
Notifications
You must be signed in to change notification settings - Fork 2
147 lines (134 loc) · 7.03 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
name: Code Generation
on: push
jobs:
build-docker-images:
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: Build asn1c docker image
run: |
cd utils/codegen/docker
docker build -t ghcr.io/${{ github.repository }}:asn1c_${{ github.sha }}_ci -f asn1c.Dockerfile .
docker push ghcr.io/${{ github.repository }}:asn1c_${{ github.sha }}_ci
- name: Build rgen docker image
run: |
cd utils/codegen/codegen-rust/docker
docker build -t ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_ci -f rgen.Dockerfile ..
docker push ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_ci
- name: Push Docker Images
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
run: |
docker tag ghcr.io/${{ github.repository }}:asn1c_${{ github.sha }}_ci ghcr.io/${{ github.repository }}:asn1c
docker push ghcr.io/${{ github.repository }}:asn1c
docker tag ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_ci ghcr.io/${{ github.repository }}:rgen
docker push ghcr.io/${{ github.repository }}:rgen
etsi_its_coding:
name: asn1c
runs-on: ubuntu-latest
needs: build-docker-images
strategy:
matrix:
include:
- message: cam
script: ./utils/codegen/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 ghcr.io/${{ github.repository }}:asn1c_${{ github.sha }}_ci
- message: denm
script: ./utils/codegen/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 ghcr.io/${{ github.repository }}:asn1c_${{ github.sha }}_ci
- message: cpm_ts
script: ./utils/codegen/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 ghcr.io/${{ github.repository }}:asn1c_${{ github.sha }}_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: Login to Docker registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: etsi_its_${{ matrix.message }}_coding
run: |
./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:
name: ROS Messages
runs-on: ubuntu-latest
needs: build-docker-images
strategy:
matrix:
include:
- message: cam
script: ./utils/codegen/codegen-rust/asn1ToRosMsg.py asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn asn1/raw/cam_en302637_2/cdd/ITS-Container.asn -o etsi_its_msgs/etsi_its_cam_msgs/msg -di ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_ci
- message: denm
script: ./utils/codegen/codegen-rust/asn1ToRosMsg.py asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn asn1/raw/denm_en302637_3/cdd/ITS-Container.asn -o etsi_its_msgs/etsi_its_denm_msgs/msg -di ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_ci
- message: cpm_ts
script: ./utils/codegen/codegen-rust/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 -o etsi_its_msgs/etsi_its_cpm_ts_msgs/msg -di ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_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: etsi_its_${{ matrix.message }}_msgs
run: |
./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:
name: Conversion Headers
runs-on: ubuntu-latest
needs: build-docker-images
strategy:
matrix:
include:
- message: cam
script: ./utils/codegen/codegen-rust/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 -di ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_ci
- message: denm
script: ./utils/codegen/codegen-rust/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 -di ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_ci
- message: cpm_ts
script: ./utils/codegen/codegen-rust/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 -di ghcr.io/${{ github.repository }}:rgen_${{ github.sha }}_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: etsi_its_${{ matrix.message }}_conversion
run: |
./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