let's test - replaced files files with new ones. #9
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
# Trigger that will run the workflow. | |
# The workflow will start on push events to the "main" branch. | |
# (Run this workflow manually or from the Actions tab) | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel. | |
# This workflow contains a single job called "commonapi-code-generator". | |
# Steps represents a sequence of tasks that will be executed as part of the job. | |
name: CI-CD CommonAPI Code Generator | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'fidl/**.fidl' | |
- '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@v2 | |
with: | |
fetch-depth: 0 | |
- name: 1) Delete old generated code, if exists. And create new folders. | |
run: | | |
rm -rf ${{ github.workspace }}/src-gen | |
mkdir -p ${{ github.workspace }}/src-gen/core | |
mkdir -p ${{ github.workspace }}/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 }}/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 }}/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 src-gen | |
git commit -m "Auto Generated fidl" || true | |
git push |