Bläddra i källkod

Add workflow to confirm version.h is in sync and integrate it into Android compilation workflow

liang.he@intel.com 1 år sedan
förälder
incheckning
2c2829ffa5

+ 34 - 0
.github/workflows/check_version_h.yml

@@ -0,0 +1,34 @@
+# Copyright (C) 2019 Intel Corporation.  All rights reserved.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+name: confirm version.h stay in sync
+
+on:
+  workflow_call:
+
+permissions:
+  contents: read
+
+jobs:
+  confirm_version:
+    runs-on: ubuntu-latest
+    outputs:
+      key: ${{ steps.create_version_h_cache_key.outputs.key}}
+    permissions:
+      contents: read
+      actions: write # for uploading cached artifact
+
+    steps:
+      - name: checkout
+        uses: actions/checkout@v4
+
+      - name: cmake execute to generate version.h
+        run: cmake -B build_version -S .
+
+      - name: confirm version.h
+        run: |
+          if [ -z "$(git status --porcelain | grep version.h)" ]; then
+            echo "version.h is in sync"
+          else
+            echo "version.h is not in sync"
+            exit 1
+          fi

+ 6 - 0
.github/workflows/compilation_on_android_ubuntu.yml

@@ -74,6 +74,12 @@ permissions:
   contents: read
 
 jobs:
+  check_version_h:
+    permissions:
+      contents: read
+      actions: write
+    uses: ./.github/workflows/check_version_h.yml
+
   build_llvm_libraries_on_ubuntu_2204:
     permissions:
       contents: read