From ec4db704b2cc0cf7647af70043d8b04b86eb43e3 Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 12 Oct 2023 19:15:34 +0900 Subject: [PATCH 1/3] add tlm-cmd-code-generation check workflow --- .github/workflows/check_code_generation.yml | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/check_code_generation.yml diff --git a/.github/workflows/check_code_generation.yml b/.github/workflows/check_code_generation.yml new file mode 100644 index 000000000..e6e9481a7 --- /dev/null +++ b/.github/workflows/check_code_generation.yml @@ -0,0 +1,37 @@ +name: check tlm_cmd code generation + +on: + push: + branches: + - main + - develop + pull_request: + +jobs: + check_code_generate: + strategy: + fail-fast: false + matrix: + user: + - mobc + - subobc + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: run tlm-cmd-code-generator + working-directory: ./tlm-cmd-code-generator + run: | + cp "./settings_${{ matrix.user }}.json" ./settings.json + python GenerateC2ACode.py + + - name: check diff + run: | + git add . + if ! git diff --exit-code --cached; then + echo "threre are some diff after code generation" + git diff HEAD + exit 1 + fi From 59f58969db1006d74019992e61a7d95231718ee6 Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 12 Oct 2023 19:22:19 +0900 Subject: [PATCH 2/3] code generator settings.json should be ignored from git --- tlm-cmd-code-generator/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tlm-cmd-code-generator/.gitignore b/tlm-cmd-code-generator/.gitignore index abe7f23f5..b49f294d0 100644 --- a/tlm-cmd-code-generator/.gitignore +++ b/tlm-cmd-code-generator/.gitignore @@ -1,3 +1,5 @@ +settings.json + # OSX .DS_Store .AppleDouble From be0f27d839d7f6fa93947590bba8a822fff02760 Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 12 Oct 2023 23:24:06 +0900 Subject: [PATCH 3/3] remove duplicated git diff --- .github/workflows/check_code_generation.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check_code_generation.yml b/.github/workflows/check_code_generation.yml index e6e9481a7..e730e3cb6 100644 --- a/.github/workflows/check_code_generation.yml +++ b/.github/workflows/check_code_generation.yml @@ -32,6 +32,5 @@ jobs: git add . if ! git diff --exit-code --cached; then echo "threre are some diff after code generation" - git diff HEAD exit 1 fi