Skip to content

test 4

test 4 #4

name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths:
- 'fidl/**.fidl'
- 'fidl/**.fdepl'
# pull_request:
# types: [opened, synchronize, reopened]
# branches: [ "main" ]
# paths:
# - '**.fidl'
# - '**.fdepl'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: 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: 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: 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: Generate CommonAPI Code from 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: Save Changes
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
- name: Checkout pull request HEAD commit
if: github.event_name == 'pull_request'
run: |
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge
git checkout -qf FETCH_HEAD
- name: Commit and push changes for pull request
if: github.event_name == 'pull_request'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add src-gen
git commit -m "Auto Generated fidl" || true
git push origin HEAD:refs/heads/${{ github.head_ref }}