Skip to content

fix coding codegen for gitlab ci #349

fix coding codegen for gitlab ci

fix coding codegen for gitlab ci #349

Workflow file for this run

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.10"
cache: pip
- name: Install dependencies
run: pip install -r ./utils/codegen/asn1ToC/requirements.txt
- 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.10"
cache: pip
- name: Install dependencies
run: pip install -r ./utils/codegen/codegen-py/requirements.txt
- 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.10"
cache: pip
- name: Install dependencies
run: pip install -r ./utils/codegen/codegen-py/requirements.txt
- 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