Add clang CI test #3
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) 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"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run in devcontainer | |
| uses: devcontainers/[email protected] | |
| with: | |
| imageName: cuCollections/clang16-dev | |
| cacheFrom: cuCollections/clang16-dev | |
| runCmd: | | |
| echo "🔧 Build Configuration:" | |
| echo " - CUDA Version: ${{ matrix.cuda }}" | |
| echo " - C++ Standard: ${{ matrix.std }}" | |
| echo " - Compiler: Clang 16" | |
| echo " - GPU Archs: ${{ matrix.gpu_build_archs }}" | |
| echo "" | |
| echo "🐳 Container Info:" | |
| clang++ --version | |
| nvcc --version || echo "nvcc not found" | |
| which clang++ | |
| echo "" | |
| echo "🏗️ Starting build with Clang 16..." | |
| ./ci/build.sh \ | |
| --cxx clang++ \ | |
| --std ${{ matrix.std }} \ | |
| --arch ${{ matrix.gpu_build_archs }} \ | |
| --infix amd64-clang16-cuda${{ matrix.cuda }} | |
| echo "🧪 Running tests..." | |
| if [[ "${{ github.event.head_commit.message }}" != *"skip-tests"* ]]; then | |
| ./ci/test.sh \ | |
| --tests \ | |
| --cxx clang++ \ | |
| --std ${{ matrix.std }} \ | |
| --arch ${{ matrix.gpu_build_archs }} \ | |
| --infix amd64-clang16-cuda${{ matrix.cuda }} | |
| else | |
| echo "⏭️ Skipping tests (skip-tests found in commit message)" | |
| fi | |
| env: | | |
| CUDA_VERSION=${{ matrix.cuda }} | |
| CXX_STD=${{ matrix.std }} | |
| GPU_BUILD_ARCHS=${{ matrix.gpu_build_archs }} | |
| CXX=clang++ | |
| CUDAHOSTCXX=clang++ | |
| configFile: .devcontainer/cuda12.8-llvm16/devcontainer.json | |
| - 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" |