Add clang CI test #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Clang 16 Build | |
| defaults: | |
| run: | |
| shell: bash -euo pipefail {0} | |
| on: | |
| push: | |
| branches: | |
| - "pull-request/[0-9]+" | |
| - main | |
| - dev | |
| pull_request: | |
| branches: | |
| - main | |
| - dev | |
| workflow_dispatch: | |
| # Only runs one instance of this workflow at a time for a given ref and cancels any in-progress runs when a new one starts. | |
| concurrency: | |
| group: ${{ github.workflow }}-on-${{ github.event_name }}-from-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| clang16-build: | |
| name: Clang 16 CUDA ${{ matrix.cuda }} Build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cuda: ["12.8"] | |
| std: [17] | |
| gpu_build_archs: ["70"] | |
| container: | |
| image: rapidsai/devcontainers:25.08-cpp-clang16-cuda${{ matrix.cuda }}-ubuntu22.04 | |
| env: | |
| NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} | |
| CUDA_VERSION: ${{ matrix.cuda }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup build environment | |
| run: | | |
| echo "CUDA_VERSION=${{ matrix.cuda }}" >> $GITHUB_ENV | |
| echo "CXX_STD=${{ matrix.std }}" >> $GITHUB_ENV | |
| echo "GPU_BUILD_ARCHS=${{ matrix.gpu_build_archs }}" >> $GITHUB_ENV | |
| - name: Build with Clang 16 | |
| run: | | |
| ./ci/build.sh \ | |
| --cxx clang++ \ | |
| --std ${{ matrix.std }} \ | |
| --arch ${{ matrix.gpu_build_archs }} \ | |
| --infix amd64-clang16-cuda${{ matrix.cuda }} | |
| env: | |
| CXX: clang++ | |
| CUDAHOSTCXX: clang++ | |
| - name: Run tests | |
| if: ${{ !contains(github.event.head_commit.message, 'skip-tests') }} | |
| run: | | |
| ./ci/test.sh \ | |
| --tests \ | |
| --cxx clang++ \ | |
| --std ${{ matrix.std }} \ | |
| --arch ${{ matrix.gpu_build_archs }} \ | |
| --infix amd64-clang16-cuda${{ matrix.cuda }} | |
| env: | |
| CXX: clang++ | |
| CUDAHOSTCXX: clang++ | |
| - name: Upload build artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: clang16-build-artifacts-cuda${{ matrix.cuda }}-std${{ matrix.std }} | |
| path: | | |
| build/ | |
| !build/**/*.o | |
| !build/**/*.a | |
| retention-days: 7 | |
| clang16-success: | |
| runs-on: ubuntu-latest | |
| name: Clang 16 Build Success | |
| if: ${{ always() }} | |
| needs: | |
| - clang16-build | |
| steps: | |
| - name: Check status of Clang 16 build | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') | |
| || contains(needs.*.result, 'cancelled') | |
| || contains(needs.*.result, 'skipped') | |
| }} | |
| run: | | |
| echo "❌ Clang 16 build failed or was cancelled" | |
| exit 1 | |
| - name: Success | |
| run: | | |
| echo "✅ Clang 16 build completed successfully" |