[llvm] attempt to introduce reusable workflow (PR #76243)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 22 06:56:02 PST 2023


https://github.com/EricWF created https://github.com/llvm/llvm-project/pull/76243

None

>From efe6fc2284a75afa70d696016959424c863b62ff Mon Sep 17 00:00:00 2001
From: eric <eric at efcs.ca>
Date: Fri, 22 Dec 2023 09:55:21 -0500
Subject: [PATCH] attempt to introduce reusable workflow

---
 .github/workflows/libcxx-build-action.yaml    |  88 +++++++++++++++
 .github/workflows/libcxx-single-workflow.yaml | 100 ++++++++++++++++++
 2 files changed, 188 insertions(+)
 create mode 100644 .github/workflows/libcxx-build-action.yaml
 create mode 100644 .github/workflows/libcxx-single-workflow.yaml

diff --git a/.github/workflows/libcxx-build-action.yaml b/.github/workflows/libcxx-build-action.yaml
new file mode 100644
index 00000000000000..f127b6e99df2ef
--- /dev/null
+++ b/.github/workflows/libcxx-build-action.yaml
@@ -0,0 +1,88 @@
+name: "Libc++ Build and Test Action"
+description: "Reusable build and test action for libc++"
+inputs:
+      ref:
+        description: 'LLVM reference to check out'
+        required: false
+        default: 'main'
+      skip_checkout:
+        description: 'Skip checking out llvm-project'
+        required: false
+        default: 'false'
+        type: choice
+        options:
+          - 'true'
+          - 'false'
+      config:
+        description: 'the run-buildbot target to use'
+        type: str
+        required: true
+      runners:
+        description: 'the runners to use'
+        type: str
+        required: false
+        default: libcxx-runners-8-set
+      cc:
+        description: 'the C compiler to use'
+        type: str
+        required: false
+        default: clang-18
+      cxx:
+        description: 'the C++ compiler to use'
+        type: str
+        required: false
+        default: clang++-18
+      enable_clang_tidy:
+        description: 'whether to enable clang-tidy'
+        type: choice
+        required: false
+        default: ON
+        options:
+            - ON
+            - OFF
+      enable_std_modules:
+        description: 'whether to enable std modules'
+        type: choice
+        required: false
+        default: ON
+        options:
+            - ON
+            - OFF
+
+runs:
+  using: "composite"
+  steps:
+    - name: Checkout llvm-project
+      if: github.event.inputs.skip_checkout == 'false'
+      uses: actions/checkout at v4
+      with:
+        repository: llvm/llvm-project
+        ref: ${{ github.event.inputs.ref }}
+    - name: run buildbot
+      cmd: libcxx/utils/ci/run-buildbot ${{ github.event.inputs.config }}
+      env:
+          CC: ${{ github.event.inputs.cc }}
+          CXX: ${{ github.event.inputs.cxx }}
+          ENABLE_CLANG_TIDY: ${{ github.event.inputs.enable_clang_tidy }}
+          ENABLE_STD_MODULES: ${{ github.event.inputs.enable_std_modules }}
+    - uses: actions/upload-artifact at v3
+      if: always()
+      with:
+        name: ${{ github.events.input.config }}-results
+        path: |
+          **/test-results.xml
+          **/*.abilist
+          **/CMakeError.log
+          **/CMakeOutput.log
+          **/crash_diagnostics/*
+
+
+
+permissions:
+  contents: read # Default everything to read-only
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+  cancel-in-progress: true
+
+
diff --git a/.github/workflows/libcxx-single-workflow.yaml b/.github/workflows/libcxx-single-workflow.yaml
new file mode 100644
index 00000000000000..c2c23e105ff2c9
--- /dev/null
+++ b/.github/workflows/libcxx-single-workflow.yaml
@@ -0,0 +1,100 @@
+# This file defines pre-commit CI for libc++, libc++abi, and libunwind (on Github).
+#
+# We split the configurations in multiple stages with the intent of saving compute time
+# when a job fails early in the pipeline. This is why the jobs are marked as `continue-on-error: false`.
+# We try to run the CI configurations with the most signal in the first stage.
+#
+# Stages 1 & 2 are meant to be "smoke tests", and are meant to catch most build/test failures quickly and without using
+# too many resources.
+# Stage 3 is "everything else", and is meant to catch breakages on more niche or unique configurations.
+#
+# Therefore, we "fail-fast" for any failures during stages 1 & 2, meaning any job failing cancels all other running jobs,
+# under the assumption that if the "smoke tests" fail, then the other configurations will likely fail in the same way.
+# However, stage 3 does not fail fast, as it's more likely that any one job failing is a flake or a configuration-specific
+#
+
+permissions:
+  contents: read # Default everything to read-only
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+  cancel-in-progress: true
+
+on:
+  workflow_dispatch:
+    inputs:
+      llvm_ref:
+        description: 'LLVM reference to check out'
+        required: false
+        default: 'main'
+      config:
+        description: 'the run-buildbot target to use'
+        type: str
+        required: true
+      runners:
+        description: 'the runners to use'
+        type: str
+        required: false
+        default: libcxx-runners-8-set
+      cc:
+        description: 'the C compiler to use'
+        type: str
+        required: false
+        default: clang-18
+      cxx:
+        description: 'the C++ compiler to use'
+        type: str
+        required: false
+        default: clang++-18
+      enable_clang_tidy:
+        description: 'whether to enable clang-tidy'
+        type: choice
+        required: false
+        default: ON
+        options:
+            - ON
+            - OFF
+      enable_std_modules:
+        description: 'whether to enable std modules'
+        type: choice
+        required: false
+        default: ON
+        options:
+            - ON
+            - OFF
+
+
+env:
+  CMAKE: "/opt/bin/cmake"
+  # LLVM POST-BRANCH bump version
+  # LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
+  # LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
+  LLVM_HEAD_VERSION: "18"   # Used compiler, update POST-BRANCH.
+  LLVM_PREVIOUS_VERSION: "17"
+  LLVM_OLDEST_VERSION: "16"
+  GCC_STABLE_VERSION: "13"
+  LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-18"
+  CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
+
+
+
+jobs:
+  build-and-test:
+    runs-on: {{ github.event.inputs.runners }}
+
+    steps:
+    - uses: ./.github/workflows/libcxx-build-action
+      with:
+        repository: llvm/llvm-project
+        ref: ${{ github.event.inputs.llvm_ref }}
+        cc: ${{ github.event.inputs.cc }}
+        cxx: ${{ github.event.inputs.cxx }}
+        config: ${{ github.event.inputs.config }}
+        enable_clang_tidy: ${{ github.event.inputs.enable_clang_tidy }}
+        enable_std_modules: ${{ github.event.inputs.enable_std_modules }}
+
+
+
+
+
+



More information about the llvm-commits mailing list