prep for merge to dev & test github automation #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-CD CommonAPI Code Generator | |
on: | |
push: | |
branches: [ "car_info" ] | |
paths: | |
- 'car_info/fidl/**.fidl' | |
- 'car_info/fidl/**.fdepl' | |
workflow_dispatch: | |
jobs: | |
commonapi-code-generator: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 0) Checkout the repository, to have the most recent fidl files. | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: 1) Delete old generated code, if exists. And create new folders. | |
run: | | |
rm -rf ${{ github.workspace }}/car_info/src-gen | |
mkdir -p ${{ github.workspace }}/car_info/src-gen/core | |
mkdir -p ${{ github.workspace }}/car_info/src-gen/someip | |
- name: 2) Download CommonAPI Core Generator. | |
run: | | |
wget https://github.com/COVESA/capicxx-core-tools/releases/download/3.2.0.1/commonapi_core_generator.zip | |
unzip commonapi_core_generator.zip -d ${{ github.workspace }}/core-generator | |
- name: 3) Download CommonAPI vSOME/IP Generator. | |
run: | | |
wget https://github.com/COVESA/capicxx-someip-tools/releases/download/3.2.0.1/commonapi_someip_generator.zip | |
unzip commonapi_someip_generator.zip -d ${{ github.workspace }}/someip-generator | |
- name: 4) Generate CommonAPI Code from Core Generator. | |
run: | | |
echo $(find ${{ github.workspace }} -type f -name '*.fidl') | |
core-generator/commonapi-core-generator-linux-x86_64 -sk $(find ${{ github.workspace }} -type f -name '*.fidl') -d ${{ github.workspace }}/car_info/src-gen/core | |
- name: 5) Generate CommonAPI Code with the vSOME/IP Generator. | |
run: | | |
echo $(find ${{ github.workspace }} -type f -name '*.fdepl') | |
someip-generator/commonapi-someip-generator-linux-x86_64 $(find ${{ github.workspace }} -type f -name '*.fdepl') -d ${{ github.workspace }}/car_info/src-gen/someip | |
- name: 6) Save generated code in src-gen (Commit and Push) | |
if: github.event_name == 'push' | |
run: | | |
git config user.name "$(git log -n 1 --pretty=format:%an)" | |
git config user.email "$(git log -n 1 --pretty=format:%ae)" | |
git add car_info/src-gen | |
git commit -m "Auto Generated fidl" || true | |
git push |