[llvm] Attempt to use composite action for libc++ builders. (PR #74489)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 08:04:33 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-github-workflow

Author: Eric (EricWF)

<details>
<summary>Changes</summary>

This will allow us to refactor the single composite action rather
than every usage of it in the workflow when we want to make changes.

For the moment, the patch references an out-of-org action, this is
only temporary to demonstrate that it works.


---
Full diff: https://github.com/llvm/llvm-project/pull/74489.diff


2 Files Affected:

- (added) .github/actions/libcxx/run-buildbot/action.yaml (+45) 
- (modified) .github/workflows/libcxx-build-and-test.yaml (+18-50) 


``````````diff
diff --git a/.github/actions/libcxx/run-buildbot/action.yaml b/.github/actions/libcxx/run-buildbot/action.yaml
new file mode 100644
index 0000000000000..b4259db2f57bd
--- /dev/null
+++ b/.github/actions/libcxx/run-buildbot/action.yaml
@@ -0,0 +1,45 @@
+name: 'Configure the runtimes build'
+description: 'Match strings against paths in diff for origin/main and current SHA'
+
+inputs:
+  configuration:
+    description: 'the configuration to build'
+    required: true
+  cxx:
+    description: 'C++ compiler'
+    required: true
+  cc:
+    description: 'C compiler'
+    required: true
+  enable_clang_tidy:
+    description: 'enable clang-tidy'
+    required: false
+    default: 'OFF'
+  std_modules:
+    description: 'enable std modules'
+    required: false
+    default: 'OFF'
+
+
+runs:
+  using: "composite"
+
+  steps:
+    - uses: actions/checkout at v4
+    - name: ${{ inputs.config }}.${{ inputs.cxx }}
+      run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+      env:
+        CC: ${{ inputs.cc }}
+        CXX: ${{ inputs.cxx }}
+        ENABLE_CLANG_TIDY: ${{ inputs.clang_tidy }}
+        ENABLE_STD_MODULES: ${{ inputs.std_modules }}
+    - uses: actions/upload-artifact at v3
+      if: always()
+      with:
+        name: ${{ inputs.config }}-${{ matrix.cxx }}-results
+        path: |
+          **/test-results.xml
+          **/*.abilist
+          **/CMakeError.log
+          **/CMakeOutput.log
+          **/crash_diagnostics/*
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index 83786052a5391..8d7485e9852c2 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -69,23 +69,13 @@ jobs:
             cxx: 'g++-13'
             clang_tidy: 'OFF'
     steps:
-      - uses: actions/checkout at v4
-      - name: ${{ matrix.config }}.${{ matrix.cxx }}
-        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
-        env:
-          CC: ${{ matrix.cc }}
-          CXX: ${{ matrix.cxx }}
-          ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
-      - uses: actions/upload-artifact at v3
-        if: always()
+      # FIXME: Change to ./.github/actions/libcxx/run-buildbot
+      - uses: libcxx/actions/run-buildbot at main
         with:
-          name: ${{ matrix.config }}-${{ matrix.cxx }}-results
-          path: |
-            **/test-results.xml
-            **/*.abilist
-            **/CMakeError.log
-            **/CMakeOutput.log
-            **/crash_diagnostics/*
+          config: ${{ matrix.config }}
+          cc: ${{ matrix.cc }}
+          cxx: ${{ matrix.cxx }}
+          clang_tidy: ${{ matrix.clang_tidy }}
   stage2:
     if: github.repository_owner == 'llvm'
     runs-on: libcxx-runners-8-set
@@ -118,23 +108,13 @@ jobs:
             cxx: 'clang++-17'
             clang_tidy: 'OFF'
     steps:
-      - uses: actions/checkout at v4
-      - name: ${{ matrix.config }}
-        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
-        env:
-          CC: ${{ matrix.cc }}
-          CXX: ${{ matrix.cxx }}
-          ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
-      - uses: actions/upload-artifact at v3
-        if: always()  # Upload artifacts even if the build or test suite fails
+      - uses: ./.github/actions/libcxx/run-buildbot
         with:
-          name: ${{ matrix.config }}-results
-          path: |
-            **/test-results.xml
-            **/*.abilist
-            **/CMakeError.log
-            **/CMakeOutput.log
-            **/crash_diagnostics/*
+          config: ${{ matrix.config }}
+          cc: ${{ matrix.cc }}
+          cxx: ${{ matrix.cxx }}
+          clang_tidy: ${{ matrix.clang_tidy }}
+
   stage3:
     if: github.repository_owner == 'llvm'
     needs: [ stage1, stage2 ]
@@ -188,22 +168,10 @@ jobs:
           std_modules: 'OFF'
     runs-on: ${{ matrix.machine }}
     steps:
-      - uses: actions/checkout at v4
-      - name: ${{ matrix.config }}
-        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
-        env:
-          CC: clang-18
-          CXX: clang++-18
-          ENABLE_CLANG_TIDY: "OFF"
-          ENABLE_STD_MODULES: ${{ matrix.std_modules }}
-      - uses: actions/upload-artifact at v3
-        if: always()
+      - uses: libcxx/actions/run-buildbot at main
         with:
-          name: ${{ matrix.config }}-results
-          path: |
-            **/test-results.xml
-            **/*.abilist
-            **/CMakeError.log
-            **/CMakeOutput.log
-            **/crash_diagnostics/*
-  
+          config: ${{ matrix.config }}
+          cc: clang-18
+          cxx: clang++-18
+          clang_tidy: "OFF"
+          std_modules: ${{ matrix.std_modules }}

``````````

</details>


https://github.com/llvm/llvm-project/pull/74489


More information about the llvm-commits mailing list