Skip to content

Add libc++ github actions workflow to replace buildkite #71836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

EricWF
Copy link
Member

@EricWF EricWF commented Nov 9, 2023

This change ports almost all of the linux buildkite builders to github actions.

I would like to have this transition occur as soon as possible.

@EricWF EricWF force-pushed the test-libcxx-pr branch 2 times, most recently from 90b686d to 4f4be4b Compare November 14, 2023 17:22
@EricWF EricWF changed the title test with libcxx workflow Add libc++ github actions workflow to replace buildkite Nov 14, 2023
@EricWF EricWF requested a review from ldionne November 14, 2023 17:43
@EricWF EricWF marked this pull request as ready for review November 14, 2023 17:43
@EricWF EricWF requested a review from a team as a code owner November 14, 2023 17:43
@llvmbot llvmbot added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. github:workflow labels Nov 14, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 14, 2023

@llvm/pr-subscribers-libcxx

@llvm/pr-subscribers-github-workflow

Author: Eric (EricWF)

Changes

This change ports almost all of the linux buildkite builders to github actions.

I would like to have this transition occur as soon as possible.


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

2 Files Affected:

  • (added) .github/workflows/libcxx-build-and-test.yaml (+137)
  • (modified) libcxx/utils/ci/run-buildbot (+2-2)
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
new file mode 100644
index 000000000000000..8083a346782946e
--- /dev/null
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -0,0 +1,137 @@
+name: Build and Test libc++
+
+on: pull_request
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+  cancel-in-progress: true
+
+permissions:
+  checks: write
+
+env:
+  CMAKE: "/opt/bin/cmake"
+
+# Comment
+jobs:
+  stage1:
+    runs-on: libcxx-runners-16
+    continue-on-error: false
+    strategy:
+      fail-fast: true
+      matrix:
+        config: [ 'generic-cxx26', 'generic-cxx03', 'generic-modules' ]
+        cc: [ 'clang-18' ]
+        cxx: [ 'clang++-18' ]
+        include:
+          - config: 'generic-gcc'
+            cc: 'gcc-13'
+            cxx: 'g++-13'
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 5
+      - name: ${{ matrix.config }}.${{ matrix.cxx }}
+        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+        env:
+          CC: ${{ matrix.cc }}
+          CXX: ${{ matrix.cxx }}
+      - uses: actions/upload-artifact@v3
+        if: always()
+        with:
+          name: ${{ matrix.config }}-${{ matrix.cxx }}-results
+          path: |
+            "**/test-results.xml"
+            "**/*.abilist"
+  stage2:
+    runs-on: libcxx-runners-16
+    needs: [ stage1  ]
+    continue-on-error: false
+    strategy:
+      fail-fast: true
+      max-parallel: 4
+      matrix:
+        config: [ 'generic-cxx11', 'generic-cxx14', 'generic-cxx17',
+                  'generic-cxx20', 'generic-cxx23' ]
+        include:
+          - config: 'generic-gcc-cxx11'
+            cc: 'gcc-13'
+            cxx: 'g++-13'
+          - config: 'generic-cxx23'
+            cc: 'clang-16'
+            cxx: 'clang++-16'
+          - config: 'generic-cxx23'
+            cc: 'clang-17'
+            cxx: 'clang++-17'
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 5
+      - name: ${{ matrix.config }}
+        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+        env:
+          CC: 'clang-18'
+          CXX: 'clang++-18'
+      - uses: actions/upload-artifact@v3
+        if: always()
+        with:
+          name: ${{ matrix.config }}-results
+          path: |
+            "**/test-results.xml"
+            "**/*.abilist"
+  stage3-sanitizers:
+    runs-on: libcxx-runners-16
+    needs: [ stage1, stage2 ]
+    continue-on-error: false
+    strategy:
+      fail-fast: true
+      matrix:
+        config: [ 'generic-asan', 'generic-msan', 'generic-tsan', 'generic-ubsan' ]
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 5
+      - name: ${{ matrix.config }}
+        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+        env:
+          CC: clang-18
+          CXX: clang++-18
+      - uses: actions/upload-artifact@v3
+        if: always()
+        with:
+          name: ${{ matrix.config }}-results
+          path: |
+            "**/test-results.xml"
+            "**/*.abilist"
+  stage3-remainder:
+    runs-on: libcxx-runners-8
+    needs: [ stage1, stage2 ]
+    continue-on-error: false
+    strategy:
+      fail-fast: true
+      max-parallel: 8
+      matrix:
+        config: [ 'generic-no-threads', 'generic-no-filesystem', 'generic-no-random_device',
+                 'generic-no-localization', 'generic-no-unicode', 'generic-no-wide-characters',
+                 'generic-no-experimental', 'generic-no-exceptions',
+                 'generic-abi-unstable',  'generic-hardening-mode-fast',
+                 'generic-hardening-mode-fast-with-abi-breaks', 'generic-hardening-mode-extensive',
+                'generic-hardening-mode-debug',
+                'generic-with_llvm_unwinder',
+                'generic-modules-lsv', 'generic-no-tzdb']
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 5
+      - name: ${{ matrix.config }}
+        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+        env:
+          CC: clang-18
+          CXX: clang++-18
+      - uses: actions/upload-artifact@v3
+        if: always()
+        with:
+          name: ${{ matrix.config }}-results
+          path: |
+            "**/test-results.xml"
+            "**/*.abilist"
+  
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index fe99388a799be8a..d1b1e0f2e05fe47 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -137,7 +137,7 @@ function generate-cmake-base() {
           -DLIBUNWIND_ENABLE_WERROR=YES \
           -DLIBCXX_ENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY} \
           ${ENABLE_STD_MODULES} \
-          -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
+          -DLLVM_LIT_ARGS="-v --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
           "${@}"
 }
 
@@ -372,7 +372,7 @@ bootstrapping-build)
           -DLLVM_TARGETS_TO_BUILD="host" \
           -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
           -DLLVM_ENABLE_ASSERTIONS=ON \
-          -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
+          -DLLVM_LIT_ARGS="-v --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
 
     echo "+++ Running the libc++ and libc++abi tests"
     ${NINJA} -vC "${BUILD_DIR}" check-runtimes

This adds a github actions replacement for most of the buildkite
pipeline. There are  a lot of benefits to using actions over buildkite,
so I'll spare the reader reciting them all. The primary reasons are:

 * More flexability
 * Easier for other contributors to maintain.
 * Easier to scale
@EricWF EricWF merged commit 9ed4a57 into llvm:main Nov 17, 2023
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
This change ports almost all of the linux buildkite builders to github
actions.

I would like to have this transition occur as soon as possible.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
This change ports almost all of the linux buildkite builders to github
actions.

I would like to have this transition occur as soon as possible.
clang_tidy: [ 'ON' ]
include:
- config: 'generic-gcc'
cc: 'gcc-13'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to use the GCC_STABLE_VERSION here and LLVM_HEAD_VERSION in other places. I added these to buildkite to reduce the maintenance while updating compilers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed it with Eric and he wants to improve that, but it wasn't easy to do because of what kind of expansion Github workflow files support.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info.

'generic-with_llvm_unwinder'
]
machine: [ 'libcxx-runners-8' ]
std_modules: [ 'OFF' ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EricWF It seems this turns off the testing of the modules in our CI. Why was this changed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns off testing standard modules for the above configurations, yes.

Modules are still enabled for the generic-cxx26 configuration below.

Turning on module for these configurations means that we no longer test these configurations without modules, correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed privately not entirely. Based on your suggestion to manually build modules instead of relying on CMake I've been working on a patch. The preparation patch for that removes this line. Since your suggested approach is a lot simpler and solves the concerns you voiced I think we can keep this as is for now and go for the simpler approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github:workflow libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants